features/steps/cli.rb in newgem-1.0.7 vs features/steps/cli.rb in newgem-1.1.0
- old
+ new
@@ -2,35 +2,44 @@
Given "a safe folder"
newgem = File.expand_path(File.dirname(__FILE__) + "/../../bin/newgem")
setup_active_project_folder project_name
FileUtils.chdir @tmp_root do
@stdout = "newgem.out"
- system "ruby #{newgem} #{project_name} > #{@stdout}"
+ system "ruby #{newgem} #{project_name} > #{@stdout} 2> #{@stdout}"
force_local_lib_override
end
end
Given %r{^an existing newgem scaffold using options '(.*)' \[called '(.*)'\]} do |arguments, project_name|
Given "a safe folder"
newgem = File.expand_path(File.dirname(__FILE__) + "/../../bin/newgem")
setup_active_project_folder project_name
FileUtils.chdir @tmp_root do
@stdout = "newgem.out"
- system "ruby #{newgem} #{arguments} #{project_name} > #{@stdout}"
+ system "ruby #{newgem} #{arguments} #{project_name} > #{@stdout} 2> #{@stdout}"
force_local_lib_override
end
end
-Given /^project website configuration for safe folder on local machine$/ do
+Given %r{^project website configuration for safe folder on local machine$} do
@remote_folder = File.expand_path(File.join(@tmp_root, 'website'))
FileUtils.rm_rf @remote_folder
FileUtils.mkdir_p @remote_folder
FileUtils.chdir @active_project_folder do
FileUtils.mkdir_p 'config'
config_yml = { "remote_dir" => @remote_folder }.to_yaml
config_path = File.join('config', 'website.yml')
File.open(config_path, "w") { |io| io << config_yml }
end
+end
+
+Given %r{^~\/([^\s]+) contains (\{.*\})$} do |file, config|
+ in_home_folder do
+ File.open(file, 'w') do |f|
+ yaml = eval(config)
+ f << yaml.to_yaml
+ end
+ end
end
def newgem_cmd
File.expand_path(File.dirname(__FILE__) + "/../../bin/newgem")
end