Sha256: 9b212967db452e3c6296b5ac28ecf053ce95be8b6743d144e4e465e78d9bccf9

Contents?: true

Size: 995 Bytes

Versions: 25

Compression:

Stored size: 995 Bytes

Contents

require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper")

module RR
  module DoubleDefinitions
    describe DoubleInjection, "#verify" do
      it_should_behave_like "Swapped Space"
      attr_reader :space, :subject, :method_name, :double_injection
      before do
        @subject = Object.new
        @method_name = :foobar
        subject.methods.should_not include(method_name.to_s)
        @double_injection = space.double_injection(subject, method_name)
      end

      it "verifies each double was met" do
        double = Double.new(
          double_injection,
          DoubleDefinition.new(DoubleDefinitions::DoubleDefinitionCreator.new, subject)
        )
        double_injection.register_double double

        double.definition.with(1).once.returns {nil}
        lambda {double_injection.verify}.should raise_error(Errors::TimesCalledError)
        subject.foobar(1)
        lambda {double_injection.verify}.should_not raise_error
      end
    end    
  end
end

Version data entries

25 entries across 25 versions & 5 rubygems

Version Path
adva-0.3.2 test/rr/spec/rr/double_injection/double_injection_verify_spec.rb
adva-0.3.1 test/rr/spec/rr/double_injection/double_injection_verify_spec.rb
adva-0.3.0 test/rr/spec/rr/double_injection/double_injection_verify_spec.rb
adva-0.2.4 test/rr/spec/rr/double_injection/double_injection_verify_spec.rb
adva-0.2.3 test/rr/spec/rr/double_injection/double_injection_verify_spec.rb
adva-0.2.2 test/rr/spec/rr/double_injection/double_injection_verify_spec.rb
adva-0.2.1 test/rr/spec/rr/double_injection/double_injection_verify_spec.rb
adva-0.2.0 test/rr/spec/rr/double_injection/double_injection_verify_spec.rb
adva-0.1.4 test/rr/spec/rr/double_injection/double_injection_verify_spec.rb
adva-0.1.3 test/rr/spec/rr/double_injection/double_injection_verify_spec.rb
adva-0.1.2 test/rr/spec/rr/double_injection/double_injection_verify_spec.rb
adva-0.1.1 test/rr/spec/rr/double_injection/double_injection_verify_spec.rb
adva-0.1.0 test/rr/spec/rr/double_injection/double_injection_verify_spec.rb
adva-0.0.1 test/rr/spec/rr/double_injection/double_injection_verify_spec.rb
jferris-rr-0.7.1.0.1239654108 spec/rr/double_injection/double_injection_verify_spec.rb
redinger-redinger-rr-0.10.3 spec/rr/double_injection/double_injection_verify_spec.rb
redinger-rr-0.10.4 spec/rr/double_injection/double_injection_verify_spec.rb
rr-0.10.2 spec/rr/double_injection/double_injection_verify_spec.rb
redinger-rr-0.10.3 spec/rr/double_injection/double_injection_verify_spec.rb
rr-0.10.0 spec/rr/double_injection/double_injection_verify_spec.rb