spec/spec_helper.rb in optionsful-0.5.1 vs spec/spec_helper.rb in optionsful-0.5.2

- old
+ new

@@ -90,9 +90,19 @@ def delete_configuration_file FileUtils.rm [File.join(Rails.root, 'config', 'optionsful.yml')] if File.exist? File.join(Rails.root, 'config', 'optionsful.yml') end + def backup_configuration_file + FileUtils.cp File.join(Rails.root, 'config', 'optionsful.yml'), File.join(Rails.root, 'config', 'optionsful.yml.tmp') if File.exist? File.join(Rails.root, 'config', 'optionsful.yml') + FileUtils.rm [File.join(Rails.root, 'config', 'optionsful.yml')] + end + + def restore_configuration_file + FileUtils.cp File.join(Rails.root, 'config', 'optionsful.yml.tmp'), File.join(Rails.root, 'config', 'optionsful.yml') if File.exist? File.join(Rails.root, 'config', 'optionsful.yml.tmp') + FileUtils.rm [File.join(Rails.root, 'config', 'optionsful.yml.tmp')] if File.exist? File.join(Rails.root, 'config', 'optionsful.yml.tmp') + end + def copy_configuration_file(name) FileUtils.cp File.join(Rails.root, 'samples', name), File.join(Rails.root, 'config', 'optionsful.yml') end def simulate_rake_yml_task