features/step_definitions/filesystem_steps.rb in berkshelf-2.0.0.beta vs features/step_definitions/filesystem_steps.rb in berkshelf-2.0.0
- old
+ new
@@ -1,10 +1,19 @@
require 'aruba/api'
World(Aruba::Api)
World(Berkshelf::RSpec::ChefAPI)
+Given /^I dynamically write to "(.+)" with:$/ do |file, contents|
+ steps %{
+ Given I write to "#{file}" with:
+ """
+ #{ERB.new(contents).result(binding)}
+ """
+ }
+end
+
Given /^a cookbook named "(.*?)"$/ do |name|
steps %{
Given a directory named "#{name}"
And an empty file named "#{name}/metadata.rb"
}
@@ -40,12 +49,12 @@
Given /^the cookbook "(.*?)" has the file "(.*?)" with:$/ do |cookbook_name, file_name, content|
write_file(::File.join(cookbook_name, file_name), content)
end
Given /^the cookbook store has the cookbooks:$/ do |cookbooks|
- cookbooks.raw.each do |name, version|
- generate_cookbook(cookbook_store, name, version)
+ cookbooks.raw.each do |name, version, license|
+ generate_cookbook(cookbook_store, name, version, license: license)
end
end
Given /^the cookbook store contains a cookbook "(.*?)" "(.*?)" with dependencies:$/ do |name, version, dependencies|
generate_cookbook(cookbook_store, name, version, dependencies: dependencies.raw)
@@ -124,10 +133,10 @@
steps %Q{ Then I should have a new cookbook skeleton "#{name}" }
cb_path = Pathname.new(current_dir).join(name)
expect(cb_path).to have_structure {
file "Berksfile" do
- contains "cookbook \"minitest-handler\""
+ contains "cookbook 'minitest-handler'"
end
file "Vagrantfile" do
contains "recipe[minitest-handler::default]"
end
directory "files" do