features: writing a configuration file should append if it's already there
This commit is contained in:
		
							parent
							
								
									dd15e3c368
								
							
						
					
					
						commit
						2adb70a247
					
				|  | @ -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 | ||||
| 
 | ||||
| # | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue