~ubuntu-branches/ubuntu/oneiric/puppet/oneiric-security

« back to all changes in this revision

Viewing changes to vendor/gems/mocha-0.5.6/test/unit/parameter_matchers/all_of_test.rb

  • Committer: Bazaar Package Importer
  • Author(s): Micah Anderson
  • Date: 2008-07-26 15:43:45 UTC
  • mfrom: (1.1.8 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080726154345-c03m49twzxewdwjn
Tags: 0.24.5-2
* Fix puppetlast to work with 0.24.5
* Adjust logcheck to match against new log messages in 0.24.5
* Update standards version to 3.8.0 (no changes)
* Update changelog to reduce length of line to make lintian happy

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require File.join(File.dirname(__FILE__), "..", "..", "test_helper")
 
2
 
 
3
require 'mocha/parameter_matchers/all_of'
 
4
require 'mocha/inspect'
 
5
require 'stub_matcher'
 
6
 
 
7
class AllOfTest < Test::Unit::TestCase
 
8
  
 
9
  include Mocha::ParameterMatchers
 
10
  
 
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'])
 
14
  end
 
15
  
 
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'])
 
19
  end
 
20
  
 
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
 
24
  end
 
25
  
 
26
end
 
 
b'\\ No newline at end of file'