Sha256: 556f96888e949865b641bdf846eac91c2cb77637db70219a08c0157b837c3c09

Contents?: true

Size: 711 Bytes

Versions: 1

Compression:

Stored size: 711 Bytes

Contents

require File.join(File.dirname(__FILE__), "..", "..", "test_helper")

require 'mocha/parameter_matchers/instance_of'
require 'mocha/inspect'

class InstanceOfTest < Test::Unit::TestCase

  include Mocha::ParameterMatchers

  def test_should_match_object_that_is_an_instance_of_specified_class
    matcher = instance_of(String)
    assert matcher.matches?(['string'])
  end

  def test_should_not_match_object_that_is_not_an_instance_of_specified_class
    matcher = instance_of(String)
    assert !matcher.matches?([99])
  end

  def test_should_describe_matcher
    matcher = instance_of(String)
    assert_equal "instance_of(#{ on_macruby? ? 'NSMutableString' : 'String' })", matcher.mocha_inspect
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mocha-macruby-0.9.8.20100129120100 test/unit/parameter_matchers/instance_of_test.rb