changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/spec/spec/matchers/mock_constraint_matchers_spec.rb

changeset 15: 64acf98d15f4
author: moriq@moriq.com
date: Mon Mar 10 10:12:58 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugins rspec
1require File.dirname(__FILE__) + '/../../spec_helper.rb'
2
3describe "The anything() mock argument constraint matcher" do
4 specify { anything.should == Object.new }
5 specify { anything.should == Class }
6 specify { anything.should == 1 }
7 specify { anything.should == "a string" }
8 specify { anything.should == :a_symbol }
9end
10
11describe "The boolean() mock argument constraint matcher" do
12 specify { boolean.should == true }
13 specify { boolean.should == false }
14 specify { boolean.should_not == Object.new }
15 specify { boolean.should_not == Class }
16 specify { boolean.should_not == 1 }
17 specify { boolean.should_not == "a string" }
18 specify { boolean.should_not == :a_symbol }
19end
20
21describe "The an_instance_of() mock argument constraint matcher" do
22 # NOTE - this is implemented as a predicate_matcher - see example_group_methods.rb
23 specify { an_instance_of(String).should == "string" }
24end