diff options
Diffstat (limited to 'features/steps/config_steps.rb')
-rw-r--r-- | features/steps/config_steps.rb | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/features/steps/config_steps.rb b/features/steps/config_steps.rb index 867702d..0785af3 100644 --- a/features/steps/config_steps.rb +++ b/features/steps/config_steps.rb @@ -16,17 +16,35 @@ # limitations under the License. # -Given /^a configuration class$/ do +Given /^a configuration class '(.+)'$/ do |classname| end -When /^I set '(.+)' to '(.+)'$/ do |key, value| - ConfigIt[key.to_sym] = value +When /^I set '(.+)' to '(.+)' in configuration class '(.+)'$/ do |key, value, classname| + + #ConfigIt[key.to_sym] = value + if classname == 'ConfigIt' + ConfigIt[key.to_sym] = value + elsif classname == 'ConfigItToo' + ConfigItToo[key.to_sym] = value + else + raise ArgumentError, "configuration class must be ConfigIt or ConfigItToo" + end end Then /^config option '(.+)' is '(.+)'$/ do |key, value| ConfigIt[key.to_sym].should == value end +Then /^in configuration class '(.+)' config option '(.+)' is '(.+)'$/ do |classname, key, value| + if classname == 'ConfigIt' + ConfigIt[key.to_sym].should == value + elsif classname == 'ConfigItToo' + ConfigItToo[key.to_sym].should == value + else + raise ArgumentError, "configuration class must be ConfigIt or ConfigItToo" + end +end + When /^I set '(.+)' to:$/ do |key, foo_table| ConfigIt[key.to_sym] = Array.new foo_table.hashes.each do |hash| |