Sha256: aa3032915b62f8f16023095d658825134d2c7c9e58e1827408896c45b1e7f801
Contents?: true
Size: 1.27 KB
Versions: 9
Compression:
Stored size: 1.27 KB
Contents
require "spec/spec_helper" describe RR do describe "#mock" do before do @subject = Object.new end it "creates a mock DoubleInjection Double" do mock(@subject).foobar(1, 2) {:baz} @subject.foobar(1, 2).should == :baz end end describe "#stub" do before do @subject = Object.new end it "creates a stub DoubleInjection Double" do stub(@subject).foobar {:baz} @subject.foobar("any", "thing").should == :baz end end describe "#mock and #proxy" do before do @subject = Object.new def @subject.foobar :baz end end it "creates a proxy DoubleInjection Double" do mock.proxy(@subject).foobar @subject.foobar.should == :baz end end describe "#stub and #proxy" do before do @subject = Object.new def @subject.foobar :baz end end it "creates a proxy DoubleInjection Double" do stub.proxy(@subject).foobar @subject.foobar.should == :baz end end describe "#stub and #proxy" do before do @subject = Object.new def @subject.foobar :baz end end it "creates a proxy DoubleInjection Double" do stub.proxy(@subject).foobar @subject.foobar.should == :baz end end end
Version data entries
9 entries across 9 versions & 1 rubygems