Sha256: e95caa2a6b325289b4fe96d9afca52debb83105abd0f992cec7abfcf692b60f8

Contents?: true

Size: 668 Bytes

Versions: 14

Compression:

Stored size: 668 Bytes

Contents

require "examples/example_helper"

describe RR, "#mock" do
  before do
    @subject = Object.new
  end

  it "creates a mock Double Scenario" do
    mock(@subject).foobar(1, 2) {:baz}
    @subject.foobar(1, 2).should == :baz
  end
end

describe RR, "#stub" do
  before do
    @subject = Object.new
  end

  it "creates a stub Double Scenario" do
    stub(@subject).foobar {:baz}
    @subject.foobar("any", "thing").should == :baz
  end
end

describe RR, "#probe" do
  before do
    @subject = Object.new
    def @subject.foobar
      :baz
    end
  end

  it "creates a probe Double Scenario" do
    probe(@subject).foobar
    @subject.foobar.should == :baz
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rr-0.1.10 examples/rr/rspec/rspec_usage_example.rb
rr-0.1.12 examples/rr/rspec/rspec_usage_example.rb
rr-0.1.15 examples/rr/rspec/rspec_usage_example.rb
rr-0.1.11 examples/rr/rspec/rspec_usage_example.rb
rr-0.1.7 examples/rr/rspec/rspec_usage_example.rb
rr-0.1.8 examples/rr/rspec/rspec_usage_example.rb
rr-0.1.13 examples/rr/rspec/rspec_usage_example.rb
rr-0.1.14 examples/rr/rspec/rspec_usage_example.rb
rr-0.2.1 examples/rr/rspec/rspec_usage_example.rb
rr-0.2.3 examples/rr/rspec/rspec_usage_example.rb
rr-0.2.5 examples/rr/rspec/rspec_usage_example.rb
rr-0.1.9 examples/rr/rspec/rspec_usage_example.rb
rr-0.2.4 examples/rr/rspec/rspec_usage_example.rb
rr-0.2.2 examples/rr/rspec/rspec_usage_example.rb