~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/instance_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/instance_of'
 
4
require 'mocha/inspect'
 
5
 
 
6
class InstanceOfTest < Test::Unit::TestCase
 
7
 
 
8
  include Mocha::ParameterMatchers
 
9
 
 
10
  def test_should_match_object_that_is_an_instance_of_specified_class
 
11
    matcher = instance_of(String)
 
12
    assert matcher.matches?(['string'])
 
13
  end
 
14
 
 
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])
 
18
  end
 
19
 
 
20
  def test_should_describe_matcher
 
21
    matcher = instance_of(String)
 
22
    assert_equal "instance_of(String)", matcher.mocha_inspect
 
23
  end
 
24
 
 
25
end