rspec-expectations 2.0.0.beta.8 → 2.0.0.beta.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +1 -1
- data/Rakefile +8 -7
- data/Upgrade.markdown +6 -6
- data/VERSION +1 -1
- data/features/expectations/customized_message.feature +1 -1
- data/features/expectations/implicit_docstrings.feature +2 -2
- data/features/matchers/access_running_example.feature +5 -5
- data/features/matchers/define_diffable_matcher.feature +2 -2
- data/features/matchers/define_matcher.feature +14 -14
- data/features/matchers/define_matcher_outside_rspec.feature +2 -2
- data/features/matchers/define_matcher_with_fluent_interface.feature +2 -2
- data/features/matchers/expect_change.feature +2 -2
- data/features/matchers/expect_error.feature +2 -2
- data/lib/rspec/expectations.rb +7 -5
- data/lib/rspec/expectations/backward_compatibility.rb +16 -0
- data/lib/rspec/expectations/differ.rb +58 -0
- data/lib/rspec/expectations/errors.rb +1 -1
- data/lib/rspec/expectations/extensions/kernel.rb +4 -4
- data/lib/rspec/expectations/extensions/rspec/core/example_group.rb +1 -1
- data/lib/rspec/expectations/fail_with.rb +6 -4
- data/lib/rspec/expectations/handler.rb +11 -11
- data/lib/rspec/expectations/version.rb +1 -1
- data/lib/rspec/matchers.rb +7 -8
- data/lib/rspec/matchers/be.rb +6 -6
- data/lib/rspec/matchers/be_close.rb +1 -1
- data/lib/rspec/matchers/be_instance_of.rb +1 -1
- data/lib/rspec/matchers/be_kind_of.rb +1 -1
- data/lib/rspec/matchers/change.rb +1 -1
- data/lib/rspec/matchers/compatibility.rb +2 -2
- data/lib/rspec/matchers/dsl.rb +4 -4
- data/lib/rspec/matchers/eq.rb +1 -1
- data/lib/rspec/matchers/eql.rb +1 -1
- data/lib/rspec/matchers/equal.rb +1 -1
- data/lib/rspec/matchers/errors.rb +1 -1
- data/lib/rspec/matchers/exist.rb +1 -1
- data/lib/rspec/matchers/extensions/instance_exec.rb +1 -1
- data/lib/rspec/matchers/generated_descriptions.rb +1 -1
- data/lib/rspec/matchers/has.rb +1 -1
- data/lib/rspec/matchers/have.rb +1 -1
- data/lib/rspec/matchers/include.rb +1 -1
- data/lib/rspec/matchers/match.rb +1 -1
- data/lib/rspec/matchers/match_array.rb +3 -3
- data/lib/rspec/matchers/matcher.rb +13 -13
- data/lib/rspec/matchers/method_missing.rb +1 -1
- data/lib/rspec/matchers/operator_matcher.rb +4 -4
- data/lib/rspec/matchers/pretty.rb +1 -1
- data/lib/rspec/matchers/raise_error.rb +1 -1
- data/lib/rspec/matchers/respond_to.rb +1 -1
- data/lib/rspec/matchers/satisfy.rb +1 -1
- data/lib/rspec/matchers/throw_symbol.rb +1 -1
- data/rspec-expectations.gemspec +17 -14
- data/spec/rspec/expectations/{differs/default_spec.rb → differ_spec.rb} +4 -36
- data/spec/rspec/expectations/fail_with_spec.rb +6 -50
- data/spec/rspec/expectations/handler_spec.rb +22 -22
- data/spec/rspec/matchers/be_close_spec.rb +1 -1
- data/spec/rspec/matchers/be_instance_of_spec.rb +1 -1
- data/spec/rspec/matchers/be_kind_of_spec.rb +1 -1
- data/spec/rspec/matchers/change_spec.rb +3 -3
- data/spec/rspec/matchers/compatibility_spec.rb +3 -3
- data/spec/rspec/matchers/description_generation_spec.rb +28 -28
- data/spec/rspec/matchers/dsl_spec.rb +3 -3
- data/spec/rspec/matchers/eq_spec.rb +1 -1
- data/spec/rspec/matchers/eql_spec.rb +1 -1
- data/spec/rspec/matchers/equal_spec.rb +1 -1
- data/spec/rspec/matchers/exist_spec.rb +1 -1
- data/spec/rspec/matchers/have_spec.rb +3 -3
- data/spec/rspec/matchers/match_array_spec.rb +3 -0
- data/spec/rspec/matchers/matcher_spec.rb +25 -25
- data/spec/rspec/matchers/operator_matcher_spec.rb +12 -12
- data/spec/rspec/matchers/throw_symbol_spec.rb +1 -1
- data/spec/spec_helper.rb +6 -7
- data/spec/support/classes.rb +1 -1
- metadata +35 -21
- data/lib/rspec/expectations/differs/default.rb +0 -62
- data/lib/rspec/expectations/differs/load-diff-lcs.rb +0 -7
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module RSpec
|
2
2
|
module Matchers
|
3
3
|
|
4
4
|
class OperatorMatcher
|
@@ -24,7 +24,7 @@ module Rspec
|
|
24
24
|
def self.use_custom_matcher_or_delegate(operator)
|
25
25
|
define_method(operator) do |expected|
|
26
26
|
if matcher = OperatorMatcher.get(@actual.class, operator)
|
27
|
-
@actual.send(::
|
27
|
+
@actual.send(::RSpec::Matchers.last_should, matcher.new(expected))
|
28
28
|
else
|
29
29
|
eval_match(@actual, operator, expected)
|
30
30
|
end
|
@@ -36,7 +36,7 @@ module Rspec
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def fail_with_message(message)
|
39
|
-
|
39
|
+
RSpec::Expectations.fail_with(message, @expected, @actual)
|
40
40
|
end
|
41
41
|
|
42
42
|
def description
|
@@ -46,7 +46,7 @@ module Rspec
|
|
46
46
|
private
|
47
47
|
|
48
48
|
def eval_match(actual, operator, expected)
|
49
|
-
::
|
49
|
+
::RSpec::Matchers.last_matcher = self
|
50
50
|
@operator, @expected = operator, expected
|
51
51
|
__delegate_operator(actual, operator, expected)
|
52
52
|
end
|
data/rspec-expectations.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rspec-expectations}
|
8
|
-
s.version = "2.0.0.beta.
|
8
|
+
s.version = "2.0.0.beta.9"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["David Chelimsky", "Chad Humphries"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-05-27}
|
13
13
|
s.description = %q{rspec expectations (should[_not] and matchers)}
|
14
14
|
s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -35,8 +35,8 @@ Gem::Specification.new do |s|
|
|
35
35
|
"features/matchers/expect_error.feature",
|
36
36
|
"features/support/env.rb",
|
37
37
|
"lib/rspec/expectations.rb",
|
38
|
-
"lib/rspec/expectations/
|
39
|
-
"lib/rspec/expectations/
|
38
|
+
"lib/rspec/expectations/backward_compatibility.rb",
|
39
|
+
"lib/rspec/expectations/differ.rb",
|
40
40
|
"lib/rspec/expectations/errors.rb",
|
41
41
|
"lib/rspec/expectations/extensions.rb",
|
42
42
|
"lib/rspec/expectations/extensions/kernel.rb",
|
@@ -73,7 +73,7 @@ Gem::Specification.new do |s|
|
|
73
73
|
"lib/rspec/matchers/satisfy.rb",
|
74
74
|
"lib/rspec/matchers/throw_symbol.rb",
|
75
75
|
"rspec-expectations.gemspec",
|
76
|
-
"spec/rspec/expectations/
|
76
|
+
"spec/rspec/expectations/differ_spec.rb",
|
77
77
|
"spec/rspec/expectations/extensions/kernel_spec.rb",
|
78
78
|
"spec/rspec/expectations/fail_with_spec.rb",
|
79
79
|
"spec/rspec/expectations/handler_spec.rb",
|
@@ -109,7 +109,7 @@ Gem::Specification.new do |s|
|
|
109
109
|
s.homepage = %q{http://github.com/rspec/expectations}
|
110
110
|
s.post_install_message = %q{**************************************************
|
111
111
|
|
112
|
-
Thank you for installing rspec-expectations-2.0.0.beta.
|
112
|
+
Thank you for installing rspec-expectations-2.0.0.beta.9
|
113
113
|
|
114
114
|
This is beta software. If you are looking
|
115
115
|
for a supported production release, please
|
@@ -121,9 +121,9 @@ Gem::Specification.new do |s|
|
|
121
121
|
s.require_paths = ["lib"]
|
122
122
|
s.rubyforge_project = %q{rspec}
|
123
123
|
s.rubygems_version = %q{1.3.6}
|
124
|
-
s.summary = %q{rspec-expectations-2.0.0.beta.
|
124
|
+
s.summary = %q{rspec-expectations-2.0.0.beta.9}
|
125
125
|
s.test_files = [
|
126
|
-
"spec/rspec/expectations/
|
126
|
+
"spec/rspec/expectations/differ_spec.rb",
|
127
127
|
"spec/rspec/expectations/extensions/kernel_spec.rb",
|
128
128
|
"spec/rspec/expectations/fail_with_spec.rb",
|
129
129
|
"spec/rspec/expectations/handler_spec.rb",
|
@@ -161,21 +161,24 @@ Gem::Specification.new do |s|
|
|
161
161
|
s.specification_version = 3
|
162
162
|
|
163
163
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
164
|
+
s.add_runtime_dependency(%q<diff-lcs>, [">= 1.1.2"])
|
164
165
|
s.add_development_dependency(%q<cucumber>, [">= 0.6.2"])
|
165
166
|
s.add_development_dependency(%q<aruba>, [">= 0.1.1"])
|
166
|
-
s.add_development_dependency(%q<rspec-core>, [">= 2.0.0.beta.
|
167
|
-
s.add_development_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.
|
167
|
+
s.add_development_dependency(%q<rspec-core>, [">= 2.0.0.beta.9"])
|
168
|
+
s.add_development_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.9"])
|
168
169
|
else
|
170
|
+
s.add_dependency(%q<diff-lcs>, [">= 1.1.2"])
|
169
171
|
s.add_dependency(%q<cucumber>, [">= 0.6.2"])
|
170
172
|
s.add_dependency(%q<aruba>, [">= 0.1.1"])
|
171
|
-
s.add_dependency(%q<rspec-core>, [">= 2.0.0.beta.
|
172
|
-
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.
|
173
|
+
s.add_dependency(%q<rspec-core>, [">= 2.0.0.beta.9"])
|
174
|
+
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.9"])
|
173
175
|
end
|
174
176
|
else
|
177
|
+
s.add_dependency(%q<diff-lcs>, [">= 1.1.2"])
|
175
178
|
s.add_dependency(%q<cucumber>, [">= 0.6.2"])
|
176
179
|
s.add_dependency(%q<aruba>, [">= 0.1.1"])
|
177
|
-
s.add_dependency(%q<rspec-core>, [">= 2.0.0.beta.
|
178
|
-
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.
|
180
|
+
s.add_dependency(%q<rspec-core>, [">= 2.0.0.beta.9"])
|
181
|
+
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.9"])
|
179
182
|
end
|
180
183
|
end
|
181
184
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'ostruct'
|
3
3
|
|
4
|
-
module
|
4
|
+
module RSpec
|
5
5
|
module Fixtures
|
6
6
|
class Animal
|
7
7
|
def initialize(name,species)
|
@@ -23,7 +23,7 @@ end
|
|
23
23
|
describe "Diff" do
|
24
24
|
before(:each) do
|
25
25
|
@options = OpenStruct.new(:diff_format => :unified, :context_lines => 3)
|
26
|
-
@differ =
|
26
|
+
@differ = RSpec::Expectations::Differ.new(@options)
|
27
27
|
end
|
28
28
|
|
29
29
|
it "should output unified diff of two strings" do
|
@@ -76,8 +76,8 @@ EOD
|
|
76
76
|
end
|
77
77
|
|
78
78
|
it "should output unified diff message of two objects" do
|
79
|
-
expected =
|
80
|
-
actual =
|
79
|
+
expected = RSpec::Fixtures::Animal.new "bob", "giraffe"
|
80
|
+
actual = RSpec::Fixtures::Animal.new "bob", "tortoise"
|
81
81
|
|
82
82
|
expected_diff = <<'EOD'
|
83
83
|
|
@@ -94,35 +94,3 @@ EOD
|
|
94
94
|
end
|
95
95
|
|
96
96
|
end
|
97
|
-
|
98
|
-
|
99
|
-
describe "Diff in context format" do
|
100
|
-
before(:each) do
|
101
|
-
@options = OpenStruct.new(:diff_format => :unified, :context_lines => 3)
|
102
|
-
@options.diff_format = :context
|
103
|
-
@differ = Rspec::Expectations::Differs::Default.new(@options)
|
104
|
-
end
|
105
|
-
|
106
|
-
it "should output unified diff message of two objects" do
|
107
|
-
expected = Rspec::Fixtures::Animal.new "bob", "giraffe"
|
108
|
-
actual = Rspec::Fixtures::Animal.new "bob", "tortoise"
|
109
|
-
|
110
|
-
expected_diff = <<'EOD'
|
111
|
-
|
112
|
-
***************
|
113
|
-
*** 1,5 ****
|
114
|
-
<Animal
|
115
|
-
name=bob,
|
116
|
-
! species=tortoise
|
117
|
-
>
|
118
|
-
--- 1,5 ----
|
119
|
-
<Animal
|
120
|
-
name=bob,
|
121
|
-
! species=giraffe
|
122
|
-
>
|
123
|
-
EOD
|
124
|
-
|
125
|
-
diff = @differ.diff_as_object(expected,actual)
|
126
|
-
diff.should == expected_diff
|
127
|
-
end
|
128
|
-
end
|
@@ -1,52 +1,28 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe RSpec::Expectations, "#fail_with with diff" do
|
4
4
|
before(:each) do
|
5
|
-
@old_differ = Rspec::Expectations.differ
|
6
|
-
Rspec::Expectations.differ = nil
|
7
|
-
end
|
8
|
-
|
9
|
-
it "should handle just a message" do
|
10
|
-
lambda {
|
11
|
-
Rspec::Expectations.fail_with "the message"
|
12
|
-
}.should fail_with("the message")
|
13
|
-
end
|
14
|
-
|
15
|
-
after(:each) do
|
16
|
-
Rspec::Expectations.differ = @old_differ
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
describe Rspec::Expectations, "#fail_with with Array" do
|
21
|
-
before(:each) do
|
22
|
-
Rspec::Core.stub!(:warn)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
describe Rspec::Expectations, "#fail_with with diff" do
|
27
|
-
before(:each) do
|
28
|
-
@old_differ = Rspec::Expectations.differ
|
29
5
|
@differ = mock("differ")
|
30
|
-
|
6
|
+
RSpec::Expectations.stub(:differ) { @differ }
|
31
7
|
end
|
32
8
|
|
33
9
|
it "should not call differ if no expected/actual" do
|
34
10
|
lambda {
|
35
|
-
|
11
|
+
RSpec::Expectations.fail_with "the message"
|
36
12
|
}.should fail_with("the message")
|
37
13
|
end
|
38
14
|
|
39
15
|
it "should call differ if expected/actual are presented separately" do
|
40
16
|
@differ.should_receive(:diff_as_string).and_return("diff")
|
41
17
|
lambda {
|
42
|
-
|
18
|
+
RSpec::Expectations.fail_with "the message", "expected", "actual"
|
43
19
|
}.should fail_with("the message\nDiff:diff")
|
44
20
|
end
|
45
21
|
|
46
22
|
it "should call differ if expected/actual are not strings" do
|
47
23
|
@differ.should_receive(:diff_as_object).and_return("diff")
|
48
24
|
lambda {
|
49
|
-
|
25
|
+
RSpec::Expectations.fail_with "the message", :expected, :actual
|
50
26
|
}.should fail_with("the message\nDiff:diff")
|
51
27
|
end
|
52
28
|
|
@@ -54,28 +30,8 @@ describe Rspec::Expectations, "#fail_with with diff" do
|
|
54
30
|
@differ.should_not_receive(:diff_as_string)
|
55
31
|
@differ.should_not_receive(:diff_as_object)
|
56
32
|
lambda {
|
57
|
-
|
33
|
+
RSpec::Expectations.fail_with "the message", lambda {}, lambda {}
|
58
34
|
}.should fail_with("the message")
|
59
35
|
end
|
60
|
-
|
61
|
-
after(:each) do
|
62
|
-
Rspec::Expectations.differ = @old_differ
|
63
|
-
end
|
64
36
|
end
|
65
37
|
|
66
|
-
describe Rspec::Expectations, "#fail_with with a nil message" do
|
67
|
-
before(:each) do
|
68
|
-
@old_differ = Rspec::Expectations.differ
|
69
|
-
Rspec::Expectations.differ = nil
|
70
|
-
end
|
71
|
-
|
72
|
-
it "should handle just a message" do
|
73
|
-
lambda {
|
74
|
-
Rspec::Expectations.fail_with nil
|
75
|
-
}.should raise_error(ArgumentError, /Failure message is nil\. Does your matcher define the appropriate failure_message_for_\* method to return a string\?/)
|
76
|
-
end
|
77
|
-
|
78
|
-
after(:each) do
|
79
|
-
Rspec::Expectations.differ = @old_differ
|
80
|
-
end
|
81
|
-
end
|
@@ -44,7 +44,7 @@ module ExampleExpectations
|
|
44
44
|
|
45
45
|
end
|
46
46
|
|
47
|
-
module
|
47
|
+
module RSpec
|
48
48
|
module Expectations
|
49
49
|
describe PositiveExpectationHandler do
|
50
50
|
describe "#handle_matcher" do
|
@@ -52,23 +52,23 @@ module Rspec
|
|
52
52
|
matcher = mock("matcher")
|
53
53
|
actual = Object.new
|
54
54
|
matcher.should_receive(:matches?).with(actual).and_return(true)
|
55
|
-
|
55
|
+
RSpec::Expectations::PositiveExpectationHandler.handle_matcher(actual, matcher)
|
56
56
|
end
|
57
57
|
|
58
58
|
it "returns the match value" do
|
59
59
|
matcher = mock("matcher")
|
60
60
|
actual = Object.new
|
61
61
|
matcher.should_receive(:matches?).with(actual).and_return(:this_value)
|
62
|
-
|
62
|
+
RSpec::Expectations::PositiveExpectationHandler.handle_matcher(actual, matcher).should == :this_value
|
63
63
|
end
|
64
64
|
|
65
65
|
it "calls failure_message_for_should if the matcher implements it" do
|
66
66
|
matcher = mock("matcher", :failure_message_for_should => "message", :matches? => false)
|
67
67
|
actual = Object.new
|
68
68
|
|
69
|
-
::
|
69
|
+
::RSpec::Expectations.should_receive(:fail_with).with("message")
|
70
70
|
|
71
|
-
|
71
|
+
RSpec::Expectations::PositiveExpectationHandler.handle_matcher(actual, matcher)
|
72
72
|
end
|
73
73
|
|
74
74
|
it "calls fail if matcher.diffable?" do
|
@@ -81,18 +81,18 @@ module Rspec
|
|
81
81
|
)
|
82
82
|
actual = Object.new
|
83
83
|
|
84
|
-
::
|
84
|
+
::RSpec::Expectations.should_receive(:fail_with).with("message", 1, 2)
|
85
85
|
|
86
|
-
|
86
|
+
RSpec::Expectations::PositiveExpectationHandler.handle_matcher(actual, matcher)
|
87
87
|
end
|
88
88
|
|
89
89
|
it "calls failure_message if the matcher does not implement failure_message_for_should" do
|
90
90
|
matcher = mock("matcher", :failure_message => "message", :matches? => false)
|
91
91
|
actual = Object.new
|
92
92
|
|
93
|
-
::
|
93
|
+
::RSpec::Expectations.should_receive(:fail_with).with("message")
|
94
94
|
|
95
|
-
|
95
|
+
RSpec::Expectations::PositiveExpectationHandler.handle_matcher(actual, matcher)
|
96
96
|
|
97
97
|
end
|
98
98
|
|
@@ -100,9 +100,9 @@ module Rspec
|
|
100
100
|
matcher = mock("matcher", :failure_message_for_should => "message", :matches? => false)
|
101
101
|
actual = Object.new
|
102
102
|
|
103
|
-
::
|
103
|
+
::RSpec::Expectations.should_receive(:fail_with).with("custom")
|
104
104
|
|
105
|
-
|
105
|
+
RSpec::Expectations::PositiveExpectationHandler.handle_matcher(actual, matcher, "custom")
|
106
106
|
end
|
107
107
|
end
|
108
108
|
end
|
@@ -113,7 +113,7 @@ module Rspec
|
|
113
113
|
matcher = mock("matcher", :does_not_match? => true, :negative_failure_message => nil)
|
114
114
|
actual = Object.new
|
115
115
|
matcher.should_receive(:does_not_match?).with(actual).and_return(true)
|
116
|
-
|
116
|
+
RSpec::Expectations::NegativeExpectationHandler.handle_matcher(actual, matcher)
|
117
117
|
end
|
118
118
|
|
119
119
|
it "asks the matcher if it matches when the matcher doesn't respond to #does_not_match?" do
|
@@ -121,7 +121,7 @@ module Rspec
|
|
121
121
|
actual = Object.new
|
122
122
|
matcher.stub!(:negative_failure_message)
|
123
123
|
matcher.should_receive(:matches?).with(actual).and_return(false)
|
124
|
-
|
124
|
+
RSpec::Expectations::NegativeExpectationHandler.handle_matcher(actual, matcher)
|
125
125
|
end
|
126
126
|
|
127
127
|
it "returns the match value" do
|
@@ -129,7 +129,7 @@ module Rspec
|
|
129
129
|
actual = Object.new
|
130
130
|
matcher.should_receive(:matches?).with(actual).and_return(false)
|
131
131
|
matcher.stub!(:negative_failure_message).and_return("ignore")
|
132
|
-
|
132
|
+
RSpec::Expectations::NegativeExpectationHandler.handle_matcher(actual, matcher).should be_false
|
133
133
|
end
|
134
134
|
|
135
135
|
|
@@ -137,9 +137,9 @@ module Rspec
|
|
137
137
|
matcher = mock("matcher", :failure_message_for_should_not => "message", :matches? => true)
|
138
138
|
actual = Object.new
|
139
139
|
|
140
|
-
::
|
140
|
+
::RSpec::Expectations.should_receive(:fail_with).with("message")
|
141
141
|
|
142
|
-
|
142
|
+
RSpec::Expectations::NegativeExpectationHandler.handle_matcher(actual, matcher)
|
143
143
|
|
144
144
|
end
|
145
145
|
|
@@ -147,9 +147,9 @@ module Rspec
|
|
147
147
|
matcher = mock("matcher", :negative_failure_message => "message", :matches? => true)
|
148
148
|
actual = Object.new
|
149
149
|
|
150
|
-
::
|
150
|
+
::RSpec::Expectations.should_receive(:fail_with).with("message")
|
151
151
|
|
152
|
-
|
152
|
+
RSpec::Expectations::NegativeExpectationHandler.handle_matcher(actual, matcher)
|
153
153
|
|
154
154
|
end
|
155
155
|
|
@@ -164,18 +164,18 @@ module Rspec
|
|
164
164
|
)
|
165
165
|
actual = Object.new
|
166
166
|
|
167
|
-
::
|
167
|
+
::RSpec::Expectations.should_receive(:fail_with).with("message", 1, 2)
|
168
168
|
|
169
|
-
|
169
|
+
RSpec::Expectations::NegativeExpectationHandler.handle_matcher(actual, matcher)
|
170
170
|
end
|
171
171
|
|
172
172
|
it "appends the :or message in the options hash passed to should" do
|
173
173
|
matcher = mock("matcher", :failure_message_for_should_not => "message", :matches? => true)
|
174
174
|
actual = Object.new
|
175
175
|
|
176
|
-
::
|
176
|
+
::RSpec::Expectations.should_receive(:fail_with).with("custom")
|
177
177
|
|
178
|
-
|
178
|
+
RSpec::Expectations::NegativeExpectationHandler.handle_matcher(actual, matcher, "custom")
|
179
179
|
end
|
180
180
|
|
181
181
|
end
|