features/step_definitions/config_steps.rb in stove-2.0.0 vs features/step_definitions/config_steps.rb in stove-3.0.0

- old
+ new

@@ -1,24 +1,7 @@ -Given /^the Stove config is empty$/ do - path = File.join(tmp_path, '_config.rb') - - write_file(path, '{}') - set_env('STOVE_CONFIG', path) +Given /^the Stove config at "(.+)" is "(.+)"/ do |variable, value| + Stove::Config.__set__(variable, value) end -Given /^the Stove config at "(.+)" is "(.*)"$/ do |path, value| - parts = path.split('.').map(&:to_sym) - parents = parts[0...-1] - - path = ENV['STOVE_CONFIG'] - config = JSON.parse(File.read(path), symbolize_names: true) - - # Vivify the hash - parent = parents.inject(config) do |config, parent| - config[parent] ||= {} - config[parent] - end - - parent[parts.last] = value - - File.open(path, 'w') { |f| f.write(JSON.generate(config)) } +Given /^the Stove config at "(.+)" is unset/ do |variable| + Stove::Config.__unset__(variable) end