spec/configuration_spec.rb in loquacious-1.4.0 vs spec/configuration_spec.rb in loquacious-1.4.1
- old
+ new
@@ -69,9 +69,28 @@
cfg[:five] = 5
cfg.five.should == 5
cfg[:five].should == 5
end
+ it 'should allow Kernel methods to be treated as configuration attributes' do
+ cfg = Loquacious::Configuration.new {
+ fork 'spoon knife spork'
+ split 'join'
+ raise 'double down'
+ puts 'not what you think'
+ }
+
+ cfg['fork'].should == 'spoon knife spork'
+ cfg['split'].should == 'join'
+ cfg['raise'].should == 'double down'
+ cfg['puts'].should == 'not what you think'
+
+ cfg[:fork].should == 'spoon knife spork'
+ cfg[:split].should == 'join'
+ cfg[:raise].should == 'double down'
+ cfg[:puts].should == 'not what you think'
+ end
+
# -----------------------------------------------------------------------
describe 'when merging' do
it 'should merge the contents of another Configuration' do
other = Loquacious::Configuration.new {