Sha256: 51bba29d4447b33b7cd53c346a4de1b9e40834a508403001fee5b958e473b679
Contents?: true
Size: 1.35 KB
Versions: 12
Compression:
Stored size: 1.35 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.double(@subject, @method_name) RR::Space.doubles.should_not be_empty @fixture.setup_mocks_for_rspec RR::Space.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.double(@subject, @method_name) scenario = RR::Space.scenario(double) scenario.once proc do @fixture.verify_mocks_for_rspec end.should raise_error(::RR::Errors::TimesCalledError) RR::Space.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.double(@subject, @method_name) RR::Space.doubles.should_not be_empty @fixture.teardown_mocks_for_rspec RR::Space.doubles.should be_empty end end end end
Version data entries
12 entries across 12 versions & 1 rubygems