Sha256: 2ceaee6b050c2e8bc6ec721ce05ac64b56824f8452c071bb060ba8ee6d3e3457
Contents?: true
Size: 1.32 KB
Versions: 1
Compression:
Stored size: 1.32 KB
Contents
require File.expand_path("#{File.dirname(__FILE__)}/../../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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rr-0.6.0 | spec/rr/rspec/rspec_usage_spec.rb |