rspec-expectations 2.8.0 → 2.9.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.yardopts +3 -0
- data/Changelog.md +176 -0
- data/README.md +2 -13
- data/features/custom_matchers/access_running_example.feature +1 -1
- data/features/step_definitions/additional_cli_steps.rb +4 -4
- data/lib/rspec/expectations/fail_with.rb +3 -3
- data/lib/rspec/expectations/handler.rb +3 -5
- data/lib/rspec/expectations/version.rb +1 -1
- data/lib/rspec/matchers.rb +387 -21
- data/lib/rspec/matchers/built_in.rb +33 -0
- data/lib/rspec/matchers/built_in/base_matcher.rb +58 -0
- data/lib/rspec/matchers/built_in/be.rb +183 -0
- data/lib/rspec/matchers/built_in/be_instance_of.rb +13 -0
- data/lib/rspec/matchers/built_in/be_kind_of.rb +13 -0
- data/lib/rspec/matchers/built_in/be_within.rb +39 -0
- data/lib/rspec/matchers/built_in/change.rb +132 -0
- data/lib/rspec/matchers/built_in/cover.rb +22 -0
- data/lib/rspec/matchers/built_in/eq.rb +26 -0
- data/lib/rspec/matchers/built_in/eql.rb +25 -0
- data/lib/rspec/matchers/built_in/equal.rb +48 -0
- data/lib/rspec/matchers/built_in/exist.rb +28 -0
- data/lib/rspec/matchers/built_in/has.rb +47 -0
- data/lib/rspec/matchers/built_in/have.rb +107 -0
- data/lib/rspec/matchers/built_in/include.rb +52 -0
- data/lib/rspec/matchers/built_in/match.rb +13 -0
- data/lib/rspec/matchers/built_in/match_array.rb +52 -0
- data/lib/rspec/matchers/built_in/raise_error.rb +96 -0
- data/lib/rspec/matchers/built_in/respond_to.rb +73 -0
- data/lib/rspec/matchers/built_in/satisfy.rb +29 -0
- data/lib/rspec/matchers/built_in/throw_symbol.rb +93 -0
- data/lib/rspec/matchers/dsl.rb +1 -1
- data/lib/rspec/matchers/matcher.rb +263 -233
- data/lib/rspec/matchers/method_missing.rb +2 -2
- data/lib/rspec/matchers/operator_matcher.rb +19 -20
- data/spec/rspec/expectations/handler_spec.rb +1 -1
- data/spec/rspec/matchers/base_matcher_spec.rb +1 -2
- data/spec/rspec/matchers/change_spec.rb +3 -3
- data/spec/rspec/matchers/cover_spec.rb +46 -46
- data/spec/rspec/matchers/dsl_spec.rb +36 -3
- data/spec/rspec/matchers/have_spec.rb +2 -2
- data/spec/rspec/matchers/include_spec.rb +1 -1
- data/spec/rspec/matchers/matcher_spec.rb +319 -305
- data/spec/rspec/matchers/method_missing_spec.rb +1 -0
- data/spec/rspec/matchers/operator_matcher_spec.rb +2 -2
- data/spec/rspec/matchers/throw_symbol_spec.rb +103 -105
- metadata +93 -39
- data/lib/rspec/matchers/base_matcher.rb +0 -56
- data/lib/rspec/matchers/be.rb +0 -232
- data/lib/rspec/matchers/be_instance_of.rb +0 -24
- data/lib/rspec/matchers/be_kind_of.rb +0 -24
- data/lib/rspec/matchers/be_within.rb +0 -47
- data/lib/rspec/matchers/change.rb +0 -197
- data/lib/rspec/matchers/cover.rb +0 -36
- data/lib/rspec/matchers/eq.rb +0 -36
- data/lib/rspec/matchers/eql.rb +0 -35
- data/lib/rspec/matchers/equal.rb +0 -58
- data/lib/rspec/matchers/errors.rb +0 -5
- data/lib/rspec/matchers/exist.rb +0 -34
- data/lib/rspec/matchers/has.rb +0 -44
- data/lib/rspec/matchers/have.rb +0 -162
- data/lib/rspec/matchers/include.rb +0 -66
- data/lib/rspec/matchers/match.rb +0 -21
- data/lib/rspec/matchers/match_array.rb +0 -65
- data/lib/rspec/matchers/raise_error.rb +0 -116
- data/lib/rspec/matchers/respond_to.rb +0 -80
- data/lib/rspec/matchers/satisfy.rb +0 -46
- data/lib/rspec/matchers/throw_symbol.rb +0 -112
@@ -196,7 +196,7 @@ describe "should <=" do
|
|
196
196
|
|
197
197
|
end
|
198
198
|
|
199
|
-
describe RSpec::Matchers::PositiveOperatorMatcher do
|
199
|
+
describe RSpec::Matchers::BuiltIn::PositiveOperatorMatcher do
|
200
200
|
|
201
201
|
it "works when the target has implemented #send" do
|
202
202
|
o = Object.new
|
@@ -208,7 +208,7 @@ describe RSpec::Matchers::PositiveOperatorMatcher do
|
|
208
208
|
|
209
209
|
end
|
210
210
|
|
211
|
-
describe RSpec::Matchers::NegativeOperatorMatcher do
|
211
|
+
describe RSpec::Matchers::BuiltIn::NegativeOperatorMatcher do
|
212
212
|
|
213
213
|
it "works when the target has implemented #send" do
|
214
214
|
o = Object.new
|
@@ -1,112 +1,110 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
module RSpec
|
4
|
-
|
5
|
-
describe
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
@matcher.failure_message_for_should.should == "expected a Symbol to be thrown, got nothing"
|
21
|
-
end
|
22
|
-
it "provides a negative failure message" do
|
23
|
-
@matcher.matches?(lambda{ throw :sym})
|
24
|
-
@matcher.failure_message_for_should_not.should == "expected no Symbol to be thrown, got :sym"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe "with a symbol" do
|
29
|
-
before(:each) { @matcher = throw_symbol(:sym) }
|
30
|
-
|
31
|
-
it "matches if correct Symbol is thrown" do
|
32
|
-
@matcher.matches?(lambda{ throw :sym }).should be_true
|
33
|
-
end
|
34
|
-
it "matches if correct Symbol is thrown with an arg" do
|
35
|
-
@matcher.matches?(lambda{ throw :sym, "argument" }).should be_true
|
36
|
-
end
|
37
|
-
it "does not match if no Symbol is thrown" do
|
38
|
-
@matcher.matches?(lambda{ }).should be_false
|
39
|
-
end
|
40
|
-
it "does not match if correct Symbol is thrown" do
|
41
|
-
@matcher.matches?(lambda{ throw :other_sym }).should be_false
|
42
|
-
end
|
43
|
-
it "provides a failure message when no Symbol is thrown" do
|
44
|
-
@matcher.matches?(lambda{})
|
45
|
-
@matcher.failure_message_for_should.should == "expected :sym to be thrown, got nothing"
|
46
|
-
end
|
47
|
-
it "provides a failure message when wrong Symbol is thrown" do
|
48
|
-
@matcher.matches?(lambda{ throw :other_sym })
|
49
|
-
@matcher.failure_message_for_should.should == "expected :sym to be thrown, got :other_sym"
|
50
|
-
end
|
51
|
-
it "provides a negative failure message" do
|
52
|
-
@matcher.matches?(lambda{ throw :sym })
|
53
|
-
@matcher.failure_message_for_should_not.should == "expected :sym not to be thrown, got :sym"
|
54
|
-
end
|
55
|
-
it "only matches NameErrors raised by uncaught throws" do
|
56
|
-
expect {
|
57
|
-
@matcher.matches?(lambda{ sym }).should be_false
|
58
|
-
}.to raise_error(NameError)
|
59
|
-
end
|
3
|
+
module RSpec::Matchers::BuiltIn
|
4
|
+
describe ThrowSymbol do
|
5
|
+
describe "with no args" do
|
6
|
+
before(:each) { @matcher = throw_symbol }
|
7
|
+
|
8
|
+
it "matches if any Symbol is thrown" do
|
9
|
+
@matcher.matches?(lambda{ throw :sym }).should be_true
|
10
|
+
end
|
11
|
+
it "matches if any Symbol is thrown with an arg" do
|
12
|
+
@matcher.matches?(lambda{ throw :sym, "argument" }).should be_true
|
13
|
+
end
|
14
|
+
it "does not match if no Symbol is thrown" do
|
15
|
+
@matcher.matches?(lambda{ }).should be_false
|
16
|
+
end
|
17
|
+
it "provides a failure message" do
|
18
|
+
@matcher.matches?(lambda{})
|
19
|
+
@matcher.failure_message_for_should.should == "expected a Symbol to be thrown, got nothing"
|
60
20
|
end
|
21
|
+
it "provides a negative failure message" do
|
22
|
+
@matcher.matches?(lambda{ throw :sym})
|
23
|
+
@matcher.failure_message_for_should_not.should == "expected no Symbol to be thrown, got :sym"
|
24
|
+
end
|
25
|
+
end
|
61
26
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
27
|
+
describe "with a symbol" do
|
28
|
+
before(:each) { @matcher = throw_symbol(:sym) }
|
29
|
+
|
30
|
+
it "matches if correct Symbol is thrown" do
|
31
|
+
@matcher.matches?(lambda{ throw :sym }).should be_true
|
32
|
+
end
|
33
|
+
it "matches if correct Symbol is thrown with an arg" do
|
34
|
+
@matcher.matches?(lambda{ throw :sym, "argument" }).should be_true
|
35
|
+
end
|
36
|
+
it "does not match if no Symbol is thrown" do
|
37
|
+
@matcher.matches?(lambda{ }).should be_false
|
38
|
+
end
|
39
|
+
it "does not match if correct Symbol is thrown" do
|
40
|
+
@matcher.matches?(lambda{ throw :other_sym }).should be_false
|
41
|
+
end
|
42
|
+
it "provides a failure message when no Symbol is thrown" do
|
43
|
+
@matcher.matches?(lambda{})
|
44
|
+
@matcher.failure_message_for_should.should == "expected :sym to be thrown, got nothing"
|
45
|
+
end
|
46
|
+
it "provides a failure message when wrong Symbol is thrown" do
|
47
|
+
@matcher.matches?(lambda{ throw :other_sym })
|
48
|
+
@matcher.failure_message_for_should.should == "expected :sym to be thrown, got :other_sym"
|
49
|
+
end
|
50
|
+
it "provides a negative failure message" do
|
51
|
+
@matcher.matches?(lambda{ throw :sym })
|
52
|
+
@matcher.failure_message_for_should_not.should == "expected :sym not to be thrown, got :sym"
|
53
|
+
end
|
54
|
+
it "only matches NameErrors raised by uncaught throws" do
|
55
|
+
expect {
|
56
|
+
@matcher.matches?(lambda{ sym }).should be_false
|
57
|
+
}.to raise_error(NameError)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
describe "with a symbol and an arg" do
|
62
|
+
before(:each) { @matcher = throw_symbol(:sym, "a") }
|
63
|
+
|
64
|
+
it "matches if correct Symbol and args are thrown" do
|
65
|
+
@matcher.matches?(lambda{ throw :sym, "a" }).should be_true
|
66
|
+
end
|
67
|
+
it "does not match if nothing is thrown" do
|
68
|
+
@matcher.matches?(lambda{ }).should be_false
|
69
|
+
end
|
70
|
+
it "does not match if other Symbol is thrown" do
|
71
|
+
@matcher.matches?(lambda{ throw :other_sym, "a" }).should be_false
|
72
|
+
end
|
73
|
+
it "does not match if no arg is thrown" do
|
74
|
+
@matcher.matches?(lambda{ throw :sym }).should be_false
|
75
|
+
end
|
76
|
+
it "does not match if wrong arg is thrown" do
|
77
|
+
@matcher.matches?(lambda{ throw :sym, "b" }).should be_false
|
78
|
+
end
|
79
|
+
it "provides a failure message when no Symbol is thrown" do
|
80
|
+
@matcher.matches?(lambda{})
|
81
|
+
@matcher.failure_message_for_should.should == %q[expected :sym with "a" to be thrown, got nothing]
|
82
|
+
end
|
83
|
+
it "provides a failure message when wrong Symbol is thrown" do
|
84
|
+
@matcher.matches?(lambda{ throw :other_sym })
|
85
|
+
@matcher.failure_message_for_should.should == %q[expected :sym with "a" to be thrown, got :other_sym]
|
86
|
+
end
|
87
|
+
it "provides a failure message when wrong arg is thrown" do
|
88
|
+
@matcher.matches?(lambda{ throw :sym, "b" })
|
89
|
+
@matcher.failure_message_for_should.should == %q[expected :sym with "a" to be thrown, got :sym with "b"]
|
90
|
+
end
|
91
|
+
it "provides a failure message when no arg is thrown" do
|
92
|
+
@matcher.matches?(lambda{ throw :sym })
|
93
|
+
@matcher.failure_message_for_should.should == %q[expected :sym with "a" to be thrown, got :sym with no argument]
|
94
|
+
end
|
95
|
+
it "provides a negative failure message" do
|
96
|
+
@matcher.matches?(lambda{ throw :sym })
|
97
|
+
@matcher.failure_message_for_should_not.should == %q[expected :sym with "a" not to be thrown, got :sym with no argument]
|
98
|
+
end
|
99
|
+
it "only matches NameErrors raised by uncaught throws" do
|
100
|
+
expect {
|
101
|
+
@matcher.matches?(lambda{ sym }).should be_false
|
102
|
+
}.to raise_error(NameError)
|
103
|
+
end
|
104
|
+
it "raises other errors" do
|
105
|
+
expect {
|
106
|
+
@matcher.matches?(lambda { raise "Boom" })
|
107
|
+
}.to raise_error(/Boom/)
|
110
108
|
end
|
111
109
|
end
|
112
110
|
end
|
metadata
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-expectations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 2405012749
|
5
|
+
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
-
-
|
8
|
+
- 9
|
9
9
|
- 0
|
10
|
-
|
10
|
+
- rc
|
11
|
+
- 2
|
12
|
+
version: 2.9.0.rc2
|
11
13
|
platform: ruby
|
12
14
|
authors:
|
13
15
|
- Steven Baker
|
@@ -16,7 +18,7 @@ autorequire:
|
|
16
18
|
bindir: bin
|
17
19
|
cert_chain: []
|
18
20
|
|
19
|
-
date: 2012-
|
21
|
+
date: 2012-03-12 00:00:00 Z
|
20
22
|
dependencies:
|
21
23
|
- !ruby/object:Gem::Dependency
|
22
24
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
@@ -24,25 +26,72 @@ dependencies:
|
|
24
26
|
requirements:
|
25
27
|
- - ~>
|
26
28
|
- !ruby/object:Gem::Version
|
27
|
-
hash:
|
29
|
+
hash: 21
|
28
30
|
segments:
|
29
31
|
- 1
|
30
32
|
- 1
|
31
|
-
-
|
32
|
-
version: 1.1.
|
33
|
+
- 3
|
34
|
+
version: 1.1.3
|
33
35
|
prerelease: false
|
34
36
|
requirement: *id001
|
35
37
|
name: diff-lcs
|
36
38
|
type: :runtime
|
39
|
+
- !ruby/object:Gem::Dependency
|
40
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 63
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
- 9
|
49
|
+
- 2
|
50
|
+
version: 0.9.2
|
51
|
+
prerelease: false
|
52
|
+
requirement: *id002
|
53
|
+
name: rake
|
54
|
+
type: :development
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 1
|
62
|
+
segments:
|
63
|
+
- 1
|
64
|
+
- 1
|
65
|
+
- 9
|
66
|
+
version: 1.1.9
|
67
|
+
prerelease: false
|
68
|
+
requirement: *id003
|
69
|
+
name: cucumber
|
70
|
+
type: :development
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
hash: 25
|
78
|
+
segments:
|
79
|
+
- 0
|
80
|
+
- 4
|
81
|
+
- 11
|
82
|
+
version: 0.4.11
|
83
|
+
prerelease: false
|
84
|
+
requirement: *id004
|
85
|
+
name: aruba
|
86
|
+
type: :development
|
37
87
|
description: rspec expectations (should[_not] and matchers)
|
38
88
|
email: rspec-users@rubyforge.org
|
39
89
|
executables: []
|
40
90
|
|
41
91
|
extensions: []
|
42
92
|
|
43
|
-
extra_rdoc_files:
|
44
|
-
|
45
|
-
- License.txt
|
93
|
+
extra_rdoc_files: []
|
94
|
+
|
46
95
|
files:
|
47
96
|
- lib/rspec-expectations.rb
|
48
97
|
- lib/rspec/expectations.rb
|
@@ -57,39 +106,42 @@ files:
|
|
57
106
|
- lib/rspec/expectations/handler.rb
|
58
107
|
- lib/rspec/expectations/version.rb
|
59
108
|
- lib/rspec/matchers.rb
|
60
|
-
- lib/rspec/matchers/base_matcher.rb
|
61
|
-
- lib/rspec/matchers/be.rb
|
62
109
|
- lib/rspec/matchers/be_close.rb
|
63
|
-
- lib/rspec/matchers/be_instance_of.rb
|
64
|
-
- lib/rspec/matchers/be_kind_of.rb
|
65
|
-
- lib/rspec/matchers/be_within.rb
|
66
110
|
- lib/rspec/matchers/block_aliases.rb
|
67
|
-
- lib/rspec/matchers/
|
111
|
+
- lib/rspec/matchers/built_in.rb
|
112
|
+
- lib/rspec/matchers/built_in/base_matcher.rb
|
113
|
+
- lib/rspec/matchers/built_in/be.rb
|
114
|
+
- lib/rspec/matchers/built_in/be_instance_of.rb
|
115
|
+
- lib/rspec/matchers/built_in/be_kind_of.rb
|
116
|
+
- lib/rspec/matchers/built_in/be_within.rb
|
117
|
+
- lib/rspec/matchers/built_in/change.rb
|
118
|
+
- lib/rspec/matchers/built_in/cover.rb
|
119
|
+
- lib/rspec/matchers/built_in/eq.rb
|
120
|
+
- lib/rspec/matchers/built_in/eql.rb
|
121
|
+
- lib/rspec/matchers/built_in/equal.rb
|
122
|
+
- lib/rspec/matchers/built_in/exist.rb
|
123
|
+
- lib/rspec/matchers/built_in/has.rb
|
124
|
+
- lib/rspec/matchers/built_in/have.rb
|
125
|
+
- lib/rspec/matchers/built_in/include.rb
|
126
|
+
- lib/rspec/matchers/built_in/match.rb
|
127
|
+
- lib/rspec/matchers/built_in/match_array.rb
|
128
|
+
- lib/rspec/matchers/built_in/raise_error.rb
|
129
|
+
- lib/rspec/matchers/built_in/respond_to.rb
|
130
|
+
- lib/rspec/matchers/built_in/satisfy.rb
|
131
|
+
- lib/rspec/matchers/built_in/throw_symbol.rb
|
68
132
|
- lib/rspec/matchers/compatibility.rb
|
69
|
-
- lib/rspec/matchers/cover.rb
|
70
133
|
- lib/rspec/matchers/dsl.rb
|
71
|
-
- lib/rspec/matchers/eq.rb
|
72
|
-
- lib/rspec/matchers/eql.rb
|
73
|
-
- lib/rspec/matchers/equal.rb
|
74
|
-
- lib/rspec/matchers/errors.rb
|
75
|
-
- lib/rspec/matchers/exist.rb
|
76
134
|
- lib/rspec/matchers/extensions/instance_eval_with_args.rb
|
77
135
|
- lib/rspec/matchers/generated_descriptions.rb
|
78
|
-
- lib/rspec/matchers/has.rb
|
79
|
-
- lib/rspec/matchers/have.rb
|
80
|
-
- lib/rspec/matchers/include.rb
|
81
|
-
- lib/rspec/matchers/match.rb
|
82
|
-
- lib/rspec/matchers/match_array.rb
|
83
136
|
- lib/rspec/matchers/matcher.rb
|
84
137
|
- lib/rspec/matchers/method_missing.rb
|
85
138
|
- lib/rspec/matchers/operator_matcher.rb
|
86
139
|
- lib/rspec/matchers/pretty.rb
|
87
|
-
- lib/rspec/matchers/raise_error.rb
|
88
|
-
- lib/rspec/matchers/respond_to.rb
|
89
|
-
- lib/rspec/matchers/satisfy.rb
|
90
|
-
- lib/rspec/matchers/throw_symbol.rb
|
91
|
-
- License.txt
|
92
140
|
- README.md
|
141
|
+
- License.txt
|
142
|
+
- Changelog.md
|
143
|
+
- .yardopts
|
144
|
+
- .document
|
93
145
|
- features/README.markdown
|
94
146
|
- features/Upgrade.md
|
95
147
|
- features/built_in_matchers/README.md
|
@@ -176,19 +228,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
176
228
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
229
|
none: false
|
178
230
|
requirements:
|
179
|
-
- - "
|
231
|
+
- - ">"
|
180
232
|
- !ruby/object:Gem::Version
|
181
|
-
hash:
|
233
|
+
hash: 25
|
182
234
|
segments:
|
183
|
-
-
|
184
|
-
|
235
|
+
- 1
|
236
|
+
- 3
|
237
|
+
- 1
|
238
|
+
version: 1.3.1
|
185
239
|
requirements: []
|
186
240
|
|
187
241
|
rubyforge_project: rspec
|
188
|
-
rubygems_version: 1.8.
|
242
|
+
rubygems_version: 1.8.15
|
189
243
|
signing_key:
|
190
244
|
specification_version: 3
|
191
|
-
summary: rspec-expectations-2.
|
245
|
+
summary: rspec-expectations-2.9.0.rc2
|
192
246
|
test_files:
|
193
247
|
- features/README.markdown
|
194
248
|
- features/Upgrade.md
|
@@ -1,56 +0,0 @@
|
|
1
|
-
module RSpec
|
2
|
-
module Matchers
|
3
|
-
# @api private
|
4
|
-
#
|
5
|
-
# Used _internally_ as a base class for matchers that ship with
|
6
|
-
# rspec-expectations.
|
7
|
-
#
|
8
|
-
# ### Warning:
|
9
|
-
#
|
10
|
-
# This class is for internal use, and subject to change without notice. We
|
11
|
-
# strongly recommend that you do not base your custom matchers on this
|
12
|
-
# class. If/when this changes, we will announce it and remove this warning.
|
13
|
-
module BaseMatcher
|
14
|
-
include RSpec::Matchers::Pretty
|
15
|
-
|
16
|
-
attr_reader :actual, :expected, :rescued_exception
|
17
|
-
|
18
|
-
def initialize(expected=nil)
|
19
|
-
@expected = expected
|
20
|
-
end
|
21
|
-
|
22
|
-
def matches?(actual)
|
23
|
-
@actual = actual
|
24
|
-
end
|
25
|
-
|
26
|
-
def match_unless_raises(exception=Exception)
|
27
|
-
begin
|
28
|
-
yield
|
29
|
-
true
|
30
|
-
rescue exception => @rescued_exception
|
31
|
-
false
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def failure_message_for_should
|
36
|
-
"expected #{actual.inspect} to #{name_to_sentence}#{expected_to_sentence}"
|
37
|
-
end
|
38
|
-
|
39
|
-
def failure_message_for_should_not
|
40
|
-
"expected #{actual.inspect} not to #{name_to_sentence}#{expected_to_sentence}"
|
41
|
-
end
|
42
|
-
|
43
|
-
def description
|
44
|
-
expected ? "#{name_to_sentence} #{expected.inspect}" : name_to_sentence
|
45
|
-
end
|
46
|
-
|
47
|
-
def diffable?
|
48
|
-
false
|
49
|
-
end
|
50
|
-
|
51
|
-
def ==(other)
|
52
|
-
matches?(other)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|