1
require File.join(File.dirname(__FILE__), "..", "..", "test_helper")
3
require 'mocha/parameter_matchers/all_of'
4
require 'mocha/inspect'
7
class AllOfTest < Test::Unit::TestCase
9
include Mocha::ParameterMatchers
11
def test_should_match_if_all_matchers_match
12
matcher = all_of(Stub::Matcher.new(true), Stub::Matcher.new(true), Stub::Matcher.new(true))
13
assert matcher.matches?(['any_old_value'])
16
def test_should_not_match_if_any_matcher_does_not_match
17
matcher = all_of(Stub::Matcher.new(true), Stub::Matcher.new(false), Stub::Matcher.new(true))
18
assert !matcher.matches?(['any_old_value'])
21
def test_should_describe_matcher
22
matcher = all_of(Stub::Matcher.new(true), Stub::Matcher.new(false), Stub::Matcher.new(true))
23
assert_equal 'all_of(matcher(true), matcher(false), matcher(true))', matcher.mocha_inspect
b'\\ No newline at end of file'