Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 54 lines (37 sloc) 1.157 kB
be013b8 @dchelimsky more words
dchelimsky authored
1 # Upgrade to rspec-expectations-2.0
cd58df8 @dchelimsky remove simple_matcher and wrap_expectation
dchelimsky authored
2
0e84dfb @dchelimsky words
dchelimsky authored
3 ## What's new
4
5 ### New `eq` matcher.
6
7 `Rspec::Matchers` now offers you two approaches to differentiating between
8 object identity. You can use the rspec-1 approach:
9
10 actual.should == expected # object equality
11 actual.should equal(expected) # object identity
12
13 ... or, if you prefer:
14
15 actual.should eq(expected) # object equality
16 actual.should be(expected) # object identity
17
cd58df8 @dchelimsky remove simple_matcher and wrap_expectation
dchelimsky authored
18 ## What's been removed
19
20 ### simple_matcher
21
22 Use Rspec::Matchers.define instead. For example, if you had:
23
24 def eat_cheese
25 simple_matcher("eat cheese") do |actual|
26 actual.eat?(:cheese)
27 end
28 end
29
30 Change it to:
31
32 Rspec::Matchers.define :eat_cheese do
33 match do |actual|
34 actual.eat?(:cheese)
35 end
36 end
37
38 ### wrap_expectation
39
40 Use Rspec::Matchers.define instead.
41
42 Rspec::Matchers.define :eat_cheese do
43 match do |actual|
44 actual.should eat?(:cheese)
45 end
46 end
47
48 Rspec::Matchers.define :eat_cheese do
49 include MyCheesyAssertions
50 match_unless_raises Test::Unit::AssertionFailedError do |actual|
51 assert_eats_chesse actual
52 end
53 end
Something went wrong with that request. Please try again.