Sha256: 7da056bbbfa9ccddd85f53bcafeeecdb8d0b9a733fde3110add4318f2e2ffada

Contents?: true

Size: 649 Bytes

Versions: 5

Compression:

Stored size: 649 Bytes

Contents

require File.expand_path('../acceptance_test_helper', __FILE__)
require 'mocha/setup'

class UnexpectedInvocationTest < Mocha::TestCase
  include AcceptanceTest

  def setup
    setup_acceptance_test
  end

  def teardown
    teardown_acceptance_test
  end

  def test_avoid_recursion_when_unexpected_invocation_exception_message_depends_on_uninspectable_object
    test_result = run_as_test do
      instance = Class.new.new
      instance.expects(:inspect).never
      instance.inspect(1, 2, 'foo')
    end
    assert_failed(test_result)
    assert_equal 'unexpected invocation: inspect(1, 2, foo)', test_result.failure_message_lines[0]
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
mocha-1.9.0 test/acceptance/unexpected_invocation_test.rb
cocoapods-dependency-html-0.0.2 vendor/bundle/gems/mocha-1.8.0/test/acceptance/unexpected_invocation_test.rb
cocoapods-dependency-html-0.0.1 vendor/bundle/gems/mocha-1.8.0/test/acceptance/unexpected_invocation_test.rb
mocha-1.8.0 test/acceptance/unexpected_invocation_test.rb
mocha-1.7.0 test/acceptance/unexpected_invocation_test.rb