spec/proxy_spec.rb in mutaconf-0.1.0 vs spec/proxy_spec.rb in mutaconf-0.1.1
- old
+ new
@@ -3,17 +3,20 @@
describe 'DSL proxies' do
let(:target){ OpenStruct.new }
let(:dsl){ Mutaconf::DSL.new options }
let(:options){ { proxy: { target => true } } }
+ let(:block){ lambda{} }
it "should proxy method calls with instance evaluation" do
target.should_receive(:a).with('b')
target.should_receive(:c=).with('d')
+ target.should_receive(:e).with('f', &block)
result = dsl.configure do
a 'b'
self.c = 'd'
+ e 'f', &block
end
result.should be(dsl)
end
it "should proxy method calls with a configuration object" do
@@ -42,13 +45,13 @@
context "with restricted keys in lenient mode" do
let(:options){ { proxy: { target => [ :a, :e ] }, lenient: true } }
it "should configure restricted properties with instance evaluation" do
- target.should_receive(:a).with('b')
+ target.should_receive(:a).with('b', &block)
target.should_receive(:e).with('f')
result = dsl.configure do
- a 'b'
+ a 'b', &block
c 'd'
e 'f'
g 'h'
end
result.should be(dsl)