Sha256: 14058d7ca0b8030ea286b139371e02a514fc5f15a3798a4cfea79dac32662d31

Contents?: true

Size: 632 Bytes

Versions: 6

Compression:

Stored size: 632 Bytes

Contents

dir = File.dirname(__FILE__)
require "#{dir}/../example_helper"

module RR
describe Double, "#verify" do
  before do
    @space = Space.new
    @object = Object.new
    @method_name = :foobar
    @object.methods.should_not include(@method_name.to_s)
    @double = @space.create_double(@object, @method_name)
  end

  it "verifies each scenario was met" do
    scenario = Scenario.new(@space)
    @double.register_scenario scenario
    
    scenario.with(1).once.returns {nil}
    proc {@double.verify}.should raise_error(Errors::TimesCalledError)
    @object.foobar(1)
    proc {@double.verify}.should_not raise_error
  end
end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rr-0.1.6 examples/rr/double_verify_example.rb
rr-0.1.3 examples/rr/double_verify_example.rb
rr-0.1.1 examples/rr/double_verify_example.rb
rr-0.1.4 examples/rr/double_verify_example.rb
rr-0.1.2 examples/rr/double_verify_example.rb
rr-0.1.5 examples/rr/double_verify_example.rb