Sha256: 11f363858c65c5427f49a7075756904960a1f99abdb78d6a6d710806018d1168

Contents?: true

Size: 1.08 KB

Versions: 16

Compression:

Stored size: 1.08 KB

Contents

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

module AdapterTests
  module TestUnit
    include Base

    def test_that_stubs_work
      assert_stubs_work
    end

    def test_that_mocks_work
      assert_mocks_work
    end

    def test_that_stub_proxies_work
      assert_stub_proxies_work
    end

    def test_that_mock_proxies_work
      assert_mock_proxies_work
    end

    def test_that_times_called_verifications_work
      assert_times_called_verifications_work
    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_raises(error_class) do
        assert_received(subject) {|s| s.foobar(1, 2, 3) }
      end
    end

    def assert_subset(subset, set)
      value = (subset - set).empty?
      message = "Set 1 was not a subset of set 2.\nSet 1: #{subset.inspect}\nSet 2: #{set.inspect}"
      assert value, message
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rr-3.1.1 spec/support/adapter_tests/test_unit.rb
rr-3.1.0 spec/support/adapter_tests/test_unit.rb
rr-3.0.9 spec/support/adapter_tests/test_unit.rb
rr-3.0.8 spec/support/adapter_tests/test_unit.rb
rr-3.0.7 spec/support/adapter_tests/test_unit.rb
rr-3.0.6 spec/support/adapter_tests/test_unit.rb
rr-3.0.5 spec/support/adapter_tests/test_unit.rb
rr-3.0.4 spec/support/adapter_tests/test_unit.rb
rr-3.0.3 spec/support/adapter_tests/test_unit.rb
rr-3.0.2 spec/support/adapter_tests/test_unit.rb
rr-3.0.1 spec/support/adapter_tests/test_unit.rb
rr-3.0.0 spec/support/adapter_tests/test_unit.rb
rr-1.2.1 spec/support/adapter_tests/test_unit.rb
rr-1.2.0 spec/support/adapter_tests/test_unit.rb
rr-1.1.2 spec/support/adapter_tests/test_unit.rb
rr-1.1.2.rc1 spec/support/adapter_tests/test_unit.rb