Sha256: bc744811be45efe1e68bc2a9df935be07fb5730ede90465fcc2e447301931602

Contents?: true

Size: 538 Bytes

Versions: 3

Compression:

Stored size: 538 Bytes

Contents

require File.expand_path('../adapter_tests', __FILE__)

module TestUnitTests
  def self.included(base)
    base.class_eval { include AdapterTests }
  end

  def test_using_assert_received
    subject = Object.new
    stub(subject).foobar(1, 2)
    subject.foobar(1, 2)
    assert_received(subject) {|s| s.foobar(1, 2) }

    error_class = RR::Errors.error_class(
      RR::Errors::SpyVerificationErrors::InvocationCountError
    )
    assert_raise(error_class) do
      assert_received(subject) {|s| s.foobar(1, 2, 3) }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rr-1.1.1.rc1 spec/suites/common/test_unit_tests.rb
rr-1.1.0 spec/suites/common/test_unit_tests.rb
rr-1.1.0.rc3 spec/suites/common/test_unit_tests.rb