Sha256: a6db6b6b21050b79ca575c48248a079157dbe0b2bead6634a8b1bd822cb39767
Contents?: true
Size: 1.45 KB
Versions: 14
Compression:
Stored size: 1.45 KB
Contents
require "examples/example_helper" module RR module Adapters describe Rspec, "#setup_mocks_for_rspec" do before do @fixture = Object.new @fixture.extend Rspec @subject = Object.new @method_name = :foobar end it "resets the doubles" do RR::Space.instance.create_double(@subject, @method_name) RR::Space.instance.doubles.should_not be_empty @fixture.setup_mocks_for_rspec RR::Space.instance.doubles.should be_empty end end describe Rspec, "#verify_mocks_for_rspec" do before do @fixture = Object.new @fixture.extend Rspec @subject = Object.new @method_name = :foobar end it "verifies the doubles" do double = RR::Space.instance.create_double(@subject, @method_name) scenario = RR::Space.instance.create_scenario(double) scenario.once proc do @fixture.verify_mocks_for_rspec end.should raise_error(::RR::Errors::TimesCalledError) RR::Space.instance.doubles.should be_empty end end describe Rspec, "#teardown_mocks_for_rspec" do before do @fixture = Object.new @fixture.extend Rspec @subject = Object.new @method_name = :foobar end it "resets the doubles" do RR::Space.instance.create_double(@subject, @method_name) RR::Space.instance.doubles.should_not be_empty @fixture.teardown_mocks_for_rspec RR::Space.instance.doubles.should be_empty end end end end
Version data entries
14 entries across 14 versions & 1 rubygems