features: writing a configuration file should append if it's already there

This commit is contained in:
Parker Moore 2016-01-18 11:42:59 -08:00
parent dd15e3c368
commit 2adb70a247
1 changed files with 7 additions and 1 deletions

View File

@ -93,7 +93,13 @@ end
#
Given %r{^I have a configuration file with "(.*)" set to "(.*)"$} do |key, value|
File.write("_config.yml", "#{key}: #{value}\n")
config = if source_dir.join("_config.yml").exist?
SafeYAML.load_file(source_dir.join("_config.yml"))
else
{}
end
config[key] = value
File.write("_config.yml", YAML.dump(config))
end
#