1
require File.join(File.dirname(__FILE__), "..", "..", "test_helper")
3
require 'mocha/parameter_matchers/instance_of'
4
require 'mocha/inspect'
6
class InstanceOfTest < Test::Unit::TestCase
8
include Mocha::ParameterMatchers
10
def test_should_match_object_that_is_an_instance_of_specified_class
11
matcher = instance_of(String)
12
assert matcher.matches?(['string'])
15
def test_should_not_match_object_that_is_not_an_instance_of_specified_class
16
matcher = instance_of(String)
17
assert !matcher.matches?([99])
20
def test_should_describe_matcher
21
matcher = instance_of(String)
22
assert_equal "instance_of(String)", matcher.mocha_inspect