Sha256: 543f5b0731ebe8449f3aaf8c55f7091b36589a0c65ee45e995278fa7018d6ffc

Contents?: true

Size: 611 Bytes

Versions: 13

Compression:

Stored size: 611 Bytes

Contents

require "examples/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)
    @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

13 entries across 13 versions & 1 rubygems

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