Sha256: 5918640d7802fc920b7a50a7a29b9784f5857fad4e7b564b303a3f013d8e6b9b

Contents?: true

Size: 443 Bytes

Versions: 3

Compression:

Stored size: 443 Bytes

Contents

shared_examples_for "proxy active_model method" do |method,opts|
	let(:target) { send opts[:from] }
	let(:target_value) { mock "value" }

	before do
		target.stub(method).and_return(target_value)
	end

	it "should proxy #{method} to #{opts[:from]}" do
		target.should_receive(method).and_return(target_value)
		subject.send(method)
	end

	it "#{method} should == #{opts[:from]}.value" do
		subject.send(method).should == target_value
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
catwalk-0.0.3 spec/support/active_model_proxy_shared_examples.rb
catwalk-0.0.2 spec/support/active_model_proxy_shared_examples.rb
catwalk-0.0.1 spec/support/active_model_proxy_shared_examples.rb