features/step_definitions/filesystem_steps.rb in berkshelf-0.6.0.beta4 vs features/step_definitions/filesystem_steps.rb in berkshelf-1.0.0.rc1
- old
+ new
@@ -16,18 +16,20 @@
Given /^I do not have a Berksfile\.lock$/ do
in_current_dir { FileUtils.rm_f(Berkshelf::Lockfile::DEFAULT_FILENAME) }
end
+Given /^I have a default Berkshelf config file$/ do
+ Berkshelf::Config.new.save
+end
+
Given /^I have a Berkshelf config file containing:$/ do |contents|
- write_file File.expand_path("~/.berkshelf/config.json"), contents
+ Berkshelf::Config.new.from_json(contents).save
end
Given /^I do not have a Berkshelf config file$/ do
- file = File.expand_path "~/.berkshelf/config.json"
-
- remove_file file if File.exists? file
+ remove_file Berkshelf::Config.path if File.exists? Berkshelf::Config.path
end
Given /^the cookbook "(.*?)" has the file "(.*?)" with:$/ do |cookbook_name, file_name, content|
write_file(File.join(cookbook_name, file_name), content)
end
@@ -231,12 +233,6 @@
check_file_presence(files.raw.map{|file_row| file_row[0]}, true)
end
Then /^the current directory should not have the following files:$/ do |files|
check_file_presence(files.raw.map{|file_row| file_row[0]}, false)
-end
-
-Then /^I should have a Berkshelf config file$/ do
- Pathname.new(ENV['HOME']).join(".berkshelf").should have_structure {
- file "config.json"
- }
end