{"id":2572,"date":"2013-04-23T11:30:05","date_gmt":"2013-04-23T02:30:05","guid":{"rendered":"http:\/\/www.creationline.com\/?p=2572"},"modified":"2023-08-29T11:44:31","modified_gmt":"2023-08-29T02:44:31","slug":"cookbook%e3%83%86%e3%82%b9%e3%83%88%e3%83%95%e3%83%ac%e3%83%bc%e3%83%a0%e3%83%af%e3%83%bc%e3%82%af%e3%80%8cchefspec%e3%80%8d-opschef_ja","status":"publish","type":"post","link":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/2572","title":{"rendered":"Cookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u300cChefSpec\u300d #opschef_ja"},"content":{"rendered":"<p><a href=\"https:\/\/github.com\/acrmp\/chefspec\">ChefSpec<\/a>\u306fCookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002<a href=\"http:\/\/rspec.info\/\">RSpec<\/a>\u3092\u7528\u3044\u305f<a href=\"https:\/\/ja.wikipedia.org\/wiki\/%E3%83%86%E3%82%B9%E3%83%88%E9%A7%86%E5%8B%95%E9%96%8B%E7%99%BA\">\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a<\/a>(TDD, Test Driven Development)\u3068\u547c\u3070\u308c\u308b\u958b\u767a\u624b\u6cd5\u306e\u305f\u3081\u306e\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3001\u307e\u305a\u30c6\u30b9\u30c8\u3092\u66f8\u304d\u3001\u6b21\u306e\u305d\u306e\u30c6\u30b9\u30c8\u3092\u30d1\u30b9\u3059\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u3001\u305d\u308c\u3089\u3092\u7e70\u308a\u8fd4\u3057\u3066\u958b\u767a\u3092\u9032\u3081\u3066\u3044\u304f\u3068\u3044\u3046\u624b\u9806\u3092\u53d6\u308a\u307e\u3059\u3002\u5b9f\u969b\u306bCookbook\u3092\u30ce\u30fc\u30c9\u306b\u9069\u7528\u305b\u305a\u3001Cookbook\u304c\u671f\u5f85\u3057\u305f\u52d5\u4f5c\u3092\u884c\u3046\u3088\u3046\u306b\u8a18\u8ff0\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u30c6\u30b9\u30c8\u3057\u307e\u3059\u3002<\/p>\n<h2>ChefSpec\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>gem\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u4ee5\u524d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308bChefSpec 0.9.0\u306fChef 11\u306b\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30aa\u30d7\u30b7\u30e7\u30f3\u306b--pre\u3092\u3064\u3051\u308b\u304b\u3001--version '1.0.0.rc1'\u3092\u3064\u3051\u3066ChefSpec 1.0.0.rc1\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f(<a href=\"https:\/\/github.com\/acrmp\/chefspec\/issues\/93\">Error in running spec and using knife in chef 11.2 and chefspec 0.9.0<\/a>, <a href=\"https:\/\/github.com\/acrmp\/chefspec\/pull\/92\">Add support for Chef 11<\/a>)\u30022013\u5e744\u670823\u65e5\u73fe\u5728\u3001ChefSpec 1.0.0\u304c\u6b63\u5f0f\u306b\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u305f\u305f\u3081\u3001\u7279\u306b\u30aa\u30d7\u30b7\u30e7\u30f3\u6307\u5b9a\u306a\u3057\u3067Chef 11\u306b\u5bfe\u5fdc\u3057\u305fChefSpec 1.0.0\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>ubuntu@kitchen:~$ sudo \/opt\/chef\/embedded\/bin\/gem install chefspec --no-rdoc --no-ri --verbose\n        :\nSuccessfully installed chefspec-1.0.0\n10 gems installed\nubuntu@kitchen:~$ \n<\/pre>\n<h2>example\u3068\u5b9f\u30b3\u30fc\u30c9\u306e\u4f5c\u6210<\/h2>\n<p>ChefSpec (RSpec)\u3067\u306f\u30c6\u30b9\u30c8\u30b1\u30fc\u30b9\u306e\u3053\u3068\u3092\u300cexample\u300d\u3068\u547c\u3073\u307e\u3059\u3002<\/p>\n<p>knife cookbook\u306e\u30b5\u30d6\u30b3\u30de\u30f3\u30c9create_specs\u3067example\u306e\u96db\u5f62\u304c\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>ubuntu@kitchen:~\/chef-repo\/cookbooks$ knife cookbook create apache2-take\n** Creating cookbook apache2-take\n** Creating README for cookbook: apache2-take\n** Creating CHANGELOG for cookbook: apache2-take\n** Creating metadata for cookbook: apache2-take\nubuntu@kitchen:~\/chef-repo\/cookbooks$ \n<\/pre>\n<pre>ubuntu@kitchen:~\/chef-repo\/cookbooks$ knife cookbook create_specs apache2-take\n** Creating specs for cookbook: apache2-take\nubuntu@kitchen:~\/chef-repo\/cookbooks$ \n<\/pre>\n<pre>ubuntu@kitchen:~\/chef-repo\/cookbooks$ ls -la apache2-take\/spec\n\u5408\u8a08 12\ndrwxr-xr-x  2 ubuntu ubuntu 4096  4\u6708 17 10:53 .\ndrwxr-xr-x 10 ubuntu ubuntu 4096  4\u6708 17 10:53 ..\n-rw-r--r--  1 ubuntu ubuntu  220  4\u6708 17 10:53 default_spec.rb\nubuntu@kitchen:~\/chef-repo\/cookbooks$ \n<\/pre>\n<p><code lang=\"ruby\"><br \/>\nubuntu@kitchen:~\/chef-repo\/cookbooks$ cat apache2-take\/spec\/default_spec.rb<br \/>\nrequire 'chefspec'<\/code><\/p>\n<p><code lang=\"ruby\"><br \/>\n<\/code><\/p>\n<p><code lang=\"ruby\">describe 'apache2-take::default' do<br \/>\nlet (:chef_run) { ChefSpec::ChefRunner.new.converge 'apache2-take::default' }<br \/>\nit 'should do something' do<br \/>\npending 'Your recipe examples go here.'<br \/>\nend<br \/>\nend<br \/>\nubuntu@kitchen:~\/chef-repo\/cookbooks$<br \/>\n<\/code><\/p>\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306bexample\u3092\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001apache2 git-core curl unzip \u306e4\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3088\u3046\u306aCookbook\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u3092\u671f\u5f85\u3059\u308bexample\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u3082\u3061\u308d\u3093\u3001Ruby\u306e\u6587\u6cd5\u3092\u7528\u3044\u3066\u8a18\u8f09\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code lang=\"ruby\"><br \/>\nubuntu@kitchen:~\/chef-repo\/cookbooks$ vi apache2-take\/spec\/default_spec.rb<br \/>\nrequire 'chefspec'<\/code><\/p>\n<p><code lang=\"ruby\"><code lang=\"ruby\"><\/code><\/code><\/p>\n<p>describe 'apache2-take::default' do<br \/>\nlet (:chef_run) { ChefSpec::ChefRunner.new.converge 'apache2-take::default' }<\/p>\n<p><code lang=\"ruby\"><br \/>\n<\/code><\/p>\n<p><code lang=\"ruby\">  %w{ apache2 git-core curl unzip }.each do |s|<br \/>\nit \"install #{s}\" do<br \/>\nchef_run.should install_package s<br \/>\nend<br \/>\nend<br \/>\nend<br \/>\nubuntu@kitchen:~\/chef-repo\/cookbooks$<br \/>\n<\/code><\/p>\n<p>rspec\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002\u5f53\u7136\u3001example\u306b\u5bfe\u5fdc\u3057\u305f\u5b9f\u30b3\u30fc\u30c9\u304c\u66f8\u304b\u308c\u3066\u3044\u306a\u3044\u306e\u3067\u30c6\u30b9\u30c8\u306f\u5931\u6557\u3057\u307e\u3059\u3002<\/p>\n<pre>ubuntu@kitchen:~\/chef-repo\/cookbooks$ rspec -fd --color apache2-take\n\napache2-take::default\n  install apache2 (FAILED - 1)\n  install git-core (FAILED - 2)\n  install curl (FAILED - 3)\n  install unzip (FAILED - 4)\n\nFailures:\n\n  1) apache2-take::default install apache2\n     Failure\/Error: chef_run.should install_package s\n       No package resource named 'apache2' with action :install found.\n     # .\/apache2-take\/spec\/default_spec.rb:8:in `block (3 levels) in &lt;top (required)&gt;'\n\n  2) apache2-take::default install git-core\n     Failure\/Error: chef_run.should install_package s\n       No package resource named 'git-core' with action :install found.\n     # .\/apache2-take\/spec\/default_spec.rb:8:in `block (3 levels) in &lt;top (required)&gt;'\n\n  3) apache2-take::default install curl\n     Failure\/Error: chef_run.should install_package s\n       No package resource named 'curl' with action :install found.\n     # .\/apache2-take\/spec\/default_spec.rb:8:in `block (3 levels) in &lt;top (required)&gt;'\n\n  4) apache2-take::default install unzip\n     Failure\/Error: chef_run.should install_package s\n       No package resource named 'unzip' with action :install found.\n     # .\/apache2-take\/spec\/default_spec.rb:8:in `block (3 levels) in &lt;top (required)&gt;'\n\nFinished in 0.00518 seconds\n4 examples, 4 failures\n\nFailed examples:\n\nrspec .\/apache2-take\/spec\/default_spec.rb:7 # apache2-take::default install apache2\nrspec .\/apache2-take\/spec\/default_spec.rb:7 # apache2-take::default install git-core\nrspec .\/apache2-take\/spec\/default_spec.rb:7 # apache2-take::default install curl\nrspec .\/apache2-take\/spec\/default_spec.rb:7 # apache2-take::default install unzip\nubuntu@kitchen:~\/chef-repo\/cookbooks$ \n<\/pre>\n<p>\u3053\u306eexample\u3092\u6e80\u305f\u3059\u3088\u3046\u306bRecipe\u3092\u66f8\u304d\u307e\u3059\u3002<\/p>\n<p><code lang=\"ruby\"><br \/>\nubuntu@kitchen:~\/chef-repo\/cookbooks$ vi apache2-take\/recipes\/default.rb<br \/>\npackage 'apache2'<br \/>\npackage 'git-core'<br \/>\npackage 'curl'<br \/>\npackage 'unzip'<br \/>\nubuntu@kitchen:~\/chef-repo\/cookbooks$<br \/>\n<\/code><\/p>\n<p>rspec\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u4eca\u5ea6\u306f\u5b9f\u30b3\u30fc\u30c9\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u30c6\u30b9\u30c8\u304c\u6210\u529f\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre>ubuntu@kitchen:~\/chef-repo\/cookbooks$ rspec -fd --color apache2-take\n\napache2-take::default\n  install apache2\n  install git-core\n  install curl\n  install unzip\n\nFinished in 0.00755 seconds\n4 examples, 0 failures\nubuntu@kitchen:~\/chef-repo\/cookbooks$ \n<\/pre>\n<p>\u5b9f\u30b3\u30fc\u30c9\u306f\u5197\u9577\u306a\u306e\u3067\u3001\u914d\u5217\u3092\u7528\u3044\u3066\u66f8\u304d\u76f4\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><code lang=\"ruby\"><br \/>\nubuntu@kitchen:~\/chef-repo\/cookbooks$ vi apache2-take\/recipes\/default.rb<br \/>\n%w{ apache2 git-core curl }.each do |s|<br \/>\npackage s<br \/>\nend<br \/>\nubuntu@kitchen:~\/chef-repo\/cookbooks$<br \/>\n<\/code><\/p>\n<p>rspec\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u5b9f\u30b3\u30fc\u30c9\u3092\u5909\u66f4\u3057\u305f\u969b\u306bunzip\u304c\u629c\u3051\u3066\u3044\u305f\u305f\u3081\u3001\u30c6\u30b9\u30c8\u304c\u5931\u6557\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306b\u3001\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u3092\u884c\u3063\u305f\u969b\u306e\u30c7\u30b0\u30ec\u30fc\u30c9\u306e\u767a\u898b\u3082\u5bb9\u6613\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>ubuntu@kitchen:~\/chef-repo\/cookbooks$ rspec -fd --color apache2-take\n\napache2-take::default\n  install apache2\n  install git-core\n  install curl\n  install unzip (FAILED - 1)\n\nFailures:\n\n  1) apache2-take::default install unzip\n     Failure\/Error: chef_run.should install_package s\n       No package resource named 'unzip' with action :install found.\n     # .\/apache2-take\/spec\/default_spec.rb:8:in `block (3 levels) in &lt;top (required)&gt;'\n\nFinished in 0.00704 seconds\n4 examples, 1 failure\n\nFailed examples:\n\nrspec .\/apache2-take\/spec\/default_spec.rb:7 # apache2-take::default install unzip\nubuntu@kitchen:~\/chef-repo\/cookbooks$ \n<\/pre>\n<p>\u518d\u3073\u5b9f\u30b3\u30fc\u30c9\u3092\u4fee\u6b63\u3057\u305f\u3053\u3068\u3067\u3001\u30c6\u30b9\u30c8\u304c\u6210\u529f\u3057\u307e\u3057\u305f\u3002<\/p>\n<p><code lang=\"ruby\"><br \/>\nubuntu@kitchen:~\/chef-repo\/cookbooks$ vi apache2-take\/recipes\/default.rb<br \/>\n%w{ apache2 git-core curl unzip }.each do |s|<br \/>\npackage s<br \/>\nend<br \/>\nubuntu@kitchen:~\/chef-repo\/cookbooks$<br \/>\n<\/code><\/p>\n<pre>ubuntu@kitchen:~\/chef-repo\/cookbooks$ rspec -fd --color apache2-take\n\napache2-take::default\n  install apache2\n  install git-core\n  install curl\n  install unzip\n\nFinished in 0.00758 seconds\n4 examples, 0 failures\nubuntu@kitchen:~\/chef-repo\/cookbooks$ \n<\/pre>\n<p>\u6700\u7d42\u7684\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306aexample\u304c\u3067\u304d\u307e\u3057\u305f\u3002\u3053\u308c\u3092\u5143\u306b\u5b9f\u30b3\u30fc\u30c9\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><code lang=\"ruby\"><br \/>\nrequire 'chefspec'<\/code><\/p>\n<p><code lang=\"ruby\"><code lang=\"ruby\"><\/code><\/code><\/p>\n<p>describe 'apache2-take::default' do<br \/>\nlet (:chef_run) { ChefSpec::ChefRunner.new.converge 'apache2-take::default' }<\/p>\n<p><code lang=\"ruby\"><code lang=\"ruby\"><\/code><\/code><\/p>\n<p>%w{ apache2 git-core curl unzip }.each do |s|<br \/>\nit \"install #{s}\" do<br \/>\nchef_run.should install_package s<br \/>\nend<br \/>\nend<\/p>\n<p><code lang=\"ruby\"><code lang=\"ruby\"><\/code><\/code><\/p>\n<p>it 'start on boot' do<br \/>\nchef_run.should set_service_to_start_on_boot 'apache2'<br \/>\nend<\/p>\n<p><code lang=\"ruby\"><code lang=\"ruby\"><\/code><\/code><\/p>\n<p>describe 'change port' do<br \/>\n%w{ \/etc\/apache2\/ports.conf \/etc\/apache2\/sites-available\/default }.each do |s|<br \/>\nit \"create #{s}\" do<br \/>\nchef_run.should create_file_with_content s, chef_run.node[ 'apache2-take' ][ 'port' ]<br \/>\nchef_run.template( s ).should be_owned_by( 'root', 'root' )<br \/>\nchef_run.template( s ).mode.should == 00644<br \/>\nchef_run.template( s ).should notify( 'service[apache2]', :restart )<br \/>\nend<br \/>\nend<br \/>\nend<\/p>\n<p><code lang=\"ruby\"><code lang=\"ruby\"><\/code><\/code><\/p>\n<p>describe 'set content' do<br \/>\ns = 'https:\/\/github.com\/cl-lab-k\/apache2-take-sample-page'<br \/>\nit \"clone #{s}\" do<br \/>\nchef_run.git( s )<br \/>\nend<\/p>\n<p><code lang=\"ruby\"><code lang=\"ruby\"><\/code><\/code><\/p>\n<p>it 'create \/var\/www\/index.html' do<br \/>\nchef_run.execute( \"cp -f #{Chef::Config[ :file_cache_path ]}\/apache2-take-sample-page\/index.html \/var\/www\/index.html\" )<br \/>\nend<br \/>\nend<\/p>\n<p><code lang=\"ruby\"><code lang=\"ruby\"><\/code><\/code><\/p>\n<p>describe 'setcontent (static)' do<br \/>\nit 'get apache2-take-sample-image.zip' do<br \/>\nchef_run.remote_file( \"https:\/\/github.com\/cl-lab-k\/apache2-take-sample-image\/archive\/master.zip\" )<br \/>\nend<\/p>\n<p><code lang=\"ruby\"><code lang=\"ruby\"><\/code><\/code><\/p>\n<p>it 'unzip apache2-take-sample-image.zip' do<br \/>\nchef_run.execute( \"unzip -o -d #{Chef::Config[ :file_cache_path ]} #{Chef::Config[ :file_cache_path ]}\/apache2-take-sample-image.zip\" )<br \/>\n# not_if { ::File.exists?( \"#{Chef::Config[ :file_cache_path ]}\/apache2-take-sample-image-master\" ) }<br \/>\nend<\/p>\n<p><code lang=\"ruby\"><code lang=\"ruby\"><\/code><\/code><\/p>\n<p>it 'move \/var\/www\/img' do<br \/>\nchef_run.execute( \"mv -f #{Chef::Config[ :file_cache_path ]}\/apache2-take-sample-image-master \/var\/www\/img\" )<br \/>\n# not_if { ::File.exists?( '\/var\/www\/img' ) }<br \/>\nend<br \/>\nend<\/p>\n<p><code lang=\"ruby\"><br \/>\n<\/code><\/p>\n<p><code lang=\"ruby\">  it 'start apache2' do<br \/>\nchef_run.should start_service 'apache2-start'<br \/>\nend<br \/>\nend<br \/>\n<\/code><\/p>\n<p>\u4ee5\u4e0a\u304cChefSpec\u306e\u6982\u7565\u3067\u3059\u3002example\u306e\u66f8\u304d\u65b9\u306b\u3064\u3044\u3066\u306f<a href=\"https:\/\/github.com\/acrmp\/chefspec\/blob\/v1.0.0\/README.md#making-assertions\">Making Assertions<\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>ChefSpec\u306f\u65e2\u306b\u3067\u304d\u3066\u3044\u308b\u5b9f\u30b3\u30fc\u30c9\u306b\u5f8c\u4ed8\u3051\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u304c\u3001\u3067\u304d\u308b\u3060\u3051example\u3092\u5148\u306b\u66f8\u304d\u3001\u5b9f\u30b3\u30fc\u30c9\u3092\u5f8c\u304b\u3089\u4f5c\u3063\u3066\u3044\u304f\u5f62\u3067\u958b\u767a\u3092\u9032\u3081\u305f\u307b\u3046\u304c\u3088\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ChefSpec\u306fCookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002RSpec\u3092\u7528\u3044\u305f\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a(TDD, Test Driven Development)\u3068\u547c\u3070\u308c\u308b\u958b\u767a\u624b\u6cd5\u306e\u305f\u3081\u306e\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3001\u307e\u305a\u30c6\u30b9\u30c8\u3092\u66f8\u304d\u3001 [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[36,31],"tags":[],"class_list":["post-2572","post","type-post","status-publish","format-standard","hentry","category-chef","category-higuchi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Cookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u300cChefSpec\u300d #opschef_ja - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3<\/title>\n<meta name=\"description\" content=\"Chef, d-higuchi |ChefSpec\u306fCookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002RSpec\u3092\u7528\u3044\u305f\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a(TDD, Test Driven\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/2572\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u300cChefSpec\u300d #opschef_ja - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\" \/>\n<meta property=\"og:description\" content=\"Chef, d-higuchi |ChefSpec\u306fCookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002RSpec\u3092\u7528\u3044\u305f\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a(TDD, Test Driven\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/2572\" \/>\n<meta property=\"og:site_name\" content=\"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/creationline\" \/>\n<meta property=\"article:published_time\" content=\"2013-04-23T02:30:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-29T02:44:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2026\/01\/screenshot.png\" \/>\n\t<meta property=\"og:image:width\" content=\"470\" \/>\n\t<meta property=\"og:image:height\" content=\"394\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Daisuke Higuchi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@creationline\" \/>\n<meta name=\"twitter:site\" content=\"@creationline\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daisuke Higuchi\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"5\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/2572#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/2572\"},\"author\":{\"name\":\"Daisuke Higuchi\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\"},\"headline\":\"Cookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u300cChefSpec\u300d #opschef_ja\",\"datePublished\":\"2013-04-23T02:30:05+00:00\",\"dateModified\":\"2023-08-29T02:44:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/2572\"},\"wordCount\":337,\"articleSection\":[\"Chef\",\"d-higuchi\"],\"inLanguage\":\"ja\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/2572\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/2572\",\"name\":\"Cookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u300cChefSpec\u300d #opschef_ja - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#website\"},\"datePublished\":\"2013-04-23T02:30:05+00:00\",\"dateModified\":\"2023-08-29T02:44:31+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\"},\"description\":\"Chef, d-higuchi |ChefSpec\u306fCookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002RSpec\u3092\u7528\u3044\u305f\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a(TDD, Test Driven\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/2572#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/2572\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/2572#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"HOME\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Chef\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Cookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u300cChefSpec\u300d #opschef_ja\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/\",\"name\":\"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\",\"description\":\"\u30a2\u30b8\u30e3\u30a4\u30eb\uff06DevOps\u3001\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6\u3001AI\uff06LLM\u306e\u5148\u7aef\u6280\u8853\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\",\"name\":\"Daisuke Higuchi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/d-higuchi-wp-icon-230x230.png\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/d-higuchi-wp-icon-230x230.png\",\"contentUrl\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/d-higuchi-wp-icon-230x230.png\",\"caption\":\"Daisuke Higuchi\"},\"description\":\"Chef\u30fbDocker\u30fbMirantis\u88fd\u54c1\u306a\u3069\u306e\u6280\u8853\u8981\u7d20\u306b\u52a0\u3048\u3066\u3001\u4f1a\u8b70\u306e\u9032\u3081\u65b9\u30fb\u6587\u7ae0\u306e\u66f8\u304d\u65b9\u306a\u3069\u306e\u696d\u52d9\u6539\u5584\u306b\u3082\u53d6\u308a\u7d44\u3093\u3067\u3044\u307e\u3059\u3002\u300cChef\u6d3b\u7528\u30ac\u30a4\u30c9\u300d\u5171\u8457\u306e\u307b\u304b\u3001Debian Official Developer\u3082\u3084\u3063\u3066\u3044\u307e\u3059\u3002\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u300cChefSpec\u300d #opschef_ja - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","description":"Chef, d-higuchi |ChefSpec\u306fCookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002RSpec\u3092\u7528\u3044\u305f\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a(TDD, Test Driven","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/2572","og_locale":"ja_JP","og_type":"article","og_title":"Cookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u300cChefSpec\u300d #opschef_ja - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","og_description":"Chef, d-higuchi |ChefSpec\u306fCookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002RSpec\u3092\u7528\u3044\u305f\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a(TDD, Test Driven","og_url":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/2572","og_site_name":"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","article_publisher":"https:\/\/www.facebook.com\/creationline","article_published_time":"2013-04-23T02:30:05+00:00","article_modified_time":"2023-08-29T02:44:31+00:00","og_image":[{"width":470,"height":394,"url":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2026\/01\/screenshot.png","type":"image\/png"}],"author":"Daisuke Higuchi","twitter_card":"summary_large_image","twitter_creator":"@creationline","twitter_site":"@creationline","twitter_misc":{"\u57f7\u7b46\u8005":"Daisuke Higuchi","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"5\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/2572#article","isPartOf":{"@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/2572"},"author":{"name":"Daisuke Higuchi","@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206"},"headline":"Cookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u300cChefSpec\u300d #opschef_ja","datePublished":"2013-04-23T02:30:05+00:00","dateModified":"2023-08-29T02:44:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/2572"},"wordCount":337,"articleSection":["Chef","d-higuchi"],"inLanguage":"ja"},{"@type":"WebPage","@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/2572","url":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/2572","name":"Cookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u300cChefSpec\u300d #opschef_ja - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","isPartOf":{"@id":"https:\/\/www.creationline.com\/tech-blog\/#website"},"datePublished":"2013-04-23T02:30:05+00:00","dateModified":"2023-08-29T02:44:31+00:00","author":{"@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206"},"description":"Chef, d-higuchi |ChefSpec\u306fCookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002RSpec\u3092\u7528\u3044\u305f\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a(TDD, Test Driven","breadcrumb":{"@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/2572#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/2572"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/2572#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"HOME","item":"https:\/\/www.creationline.com\/tech-blog"},{"@type":"ListItem","position":2,"name":"\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6","item":"https:\/\/www.creationline.com\/tech-blog\/cloudnative"},{"@type":"ListItem","position":3,"name":"Chef","item":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef"},{"@type":"ListItem","position":4,"name":"Cookbook\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u300cChefSpec\u300d #opschef_ja"}]},{"@type":"WebSite","@id":"https:\/\/www.creationline.com\/tech-blog\/#website","url":"https:\/\/www.creationline.com\/tech-blog\/","name":"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","description":"\u30a2\u30b8\u30e3\u30a4\u30eb\uff06DevOps\u3001\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6\u3001AI\uff06LLM\u306e\u5148\u7aef\u6280\u8853","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.creationline.com\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206","name":"Daisuke Higuchi","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2023\/08\/d-higuchi-wp-icon-230x230.png","url":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2023\/08\/d-higuchi-wp-icon-230x230.png","contentUrl":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2023\/08\/d-higuchi-wp-icon-230x230.png","caption":"Daisuke Higuchi"},"description":"Chef\u30fbDocker\u30fbMirantis\u88fd\u54c1\u306a\u3069\u306e\u6280\u8853\u8981\u7d20\u306b\u52a0\u3048\u3066\u3001\u4f1a\u8b70\u306e\u9032\u3081\u65b9\u30fb\u6587\u7ae0\u306e\u66f8\u304d\u65b9\u306a\u3069\u306e\u696d\u52d9\u6539\u5584\u306b\u3082\u53d6\u308a\u7d44\u3093\u3067\u3044\u307e\u3059\u3002\u300cChef\u6d3b\u7528\u30ac\u30a4\u30c9\u300d\u5171\u8457\u306e\u307b\u304b\u3001Debian Official Developer\u3082\u3084\u3063\u3066\u3044\u307e\u3059\u3002","url":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi"}]}},"_links":{"self":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts\/2572","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/comments?post=2572"}],"version-history":[{"count":1,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts\/2572\/revisions"}],"predecessor-version":[{"id":65721,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts\/2572\/revisions\/65721"}],"wp:attachment":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/media?parent=2572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/categories?post=2572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/tags?post=2572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}