1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
require 'spec_helper'
describe Configurate::Settings do
describe "#method_missing" do
subject { described_class.create }
it "delegates the call to a new proxy object" do
proxy = mock
Configurate::Proxy.should_receive(:new).and_return(proxy)
proxy.should_receive(:method_missing).with(:some_setting).and_return("foo")
subject.some_setting
end
end
[:lookup, :add_provider, :[]].each do |method|
describe "#{method}" do
subject { described_class.create }
it "delegates the call to #lookup_chain" do
subject.lookup_chain.should_receive(method)
subject.send(method)
end
end
end
end
|