readme.md in praegustator-0.1.0 vs readme.md in praegustator-0.2.0

- old
+ new

@@ -18,31 +18,44 @@ Praegustator provides chef conventions based methods like `role`, `recipe`, `ip`, `search` to group similar nodes for executing check against them, whereas checks are rspec files with server-spec matchers defined in `spec_dir` sample recipe for praegustator: -``` ruby sample_recipe.rb +``` ruby +#sample_recipe.rb environment :staging role("web-server") do check "application/nginx" check "application/puma" check "application/s3cmd" + properties name: "foo" end ``` The `role` method mark all nodes with that role . Within the block passed to `role` you can declare checks using the `check` method. +arbitrary hash can be passed to checks usin `properties` method, also +current node under test is added automatically to properties hash. Where check are server spec files: -``` ruby #{spec_dir}/application/nginx.rb +``` ruby +#{spec_dir}/application/nginx.rb + describe package('nginx') do it { should be_installed } end describe service('nginx') do it { should be_enabled } it { should be_running } +end + +app_name = property[:name] +ip_address = property[:current_node].ipaddress + +describe file("/etc/nginx/conf.d/#{app_name}.conf") do + it { should contain "server_name #{ip_address}" } end ``` ## `praeg` command