lib/cucumber/chef/steps/chef_steps.rb in cucumber-chef-2.1.0.rc.12 vs lib/cucumber/chef/steps/chef_steps.rb in cucumber-chef-2.1.0.rc.14

- old
+ new

@@ -19,37 +19,24 @@ # ################################################################################ And /^the following (databag|databags) (has|have) been (updated|uploaded):$/ do |ignore0, ignore1, ignore2, table| table.hashes.each do |entry| - data_bag = entry['databag'] - data_bag_path = entry['databag_path'] - $test_lab.knife_cli(%Q{data bag create "#{data_bag}"}, :silence => true) - $test_lab.knife_cli(%Q{data bag from file "#{data_bag}" "#{data_bag_path}"}, :silence => true) + create_data_bag(entry['databag'], entry['databag_path']) end end And /^the following (databag|databags) (has|have) been (deleted|removed):$/ do |ignore0, ignore1, ignore2, table| table.hashes.each do |entry| - data_bag = entry['databag'] - $test_lab.knife_cli(%Q{data bag delete "#{data_bag}" --yes}, :silence => true) + delete_data_bag(entry['databag']) end end ################################################################################ And /^the following (role|roles) (has|have) been (updated|uploaded):$/ do |ignore0, ignore1, ignore2, table| table.hashes.each do |entry| - role = entry['role'] - role_path = entry['role_path'] - - if File.extname(role).empty? - Dir.glob(File.join(role_path, "#{role}.*")).each do |role_file| - $test_lab.knife_cli(%Q{role from file #{role_file}}, :silence => true) - end - else - $test_lab.knife_cli(%Q{role from file #{File.join(role_path, role)}}, :silence => true) - end + role_from_file(entry['role'], entry['role_path']) end end ################################################################################