templates/default.erb in chefspec-bootstrap-0.0.2 vs templates/default.erb in chefspec-bootstrap-0.0.3
- old
+ new
@@ -1,13 +1,12 @@
require 'chefspec'
describe '<%= cookbook %>::<%= recipe %>' do
- let(:chef_run) { ChefSpec::Runner.new.converge(described_recipe) }
+ let(:chef_run) { ChefSpec::Runner.new.converge(described_recipe) }<% if not test_cases.empty? %><% test_cases.each do |test_case| %>
+ it "<%= test_case[:it] %>" do
+ expect(chef_run).to <%= test_case[:expect] %>("<%= test_case[:name] %>")
+ end<% end %><% else %>
it 'runs successfully' do
expect{chef_run}.not_to raise_error
- end<% if test_cases %><% test_cases.each do |test_case| %>
-
- it "<%= test_case[:it] %>" do
- expect(chef_run).to <%= test_case[:action] %>("<%= test_case[:name] %>")
- end<% end %><% end %>
+ end<% end %>
end