1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2019-12-27 17:36:04 +01:00
parent fe3d9d2832
commit 74fdc1e60f

View file

@ -3,7 +3,10 @@ class Object
def should(matcher = NO_MATCHER_GIVEN)
MSpec.expectation
MSpec.actions :expectation, MSpec.current.state
state = MSpec.current.state
raise "should outside example" unless state
MSpec.actions :expectation, state
if NO_MATCHER_GIVEN.equal?(matcher)
SpecPositiveOperatorMatcher.new(self)
else
@ -16,7 +19,10 @@ class Object
def should_not(matcher = NO_MATCHER_GIVEN)
MSpec.expectation
MSpec.actions :expectation, MSpec.current.state
state = MSpec.current.state
raise "should_not outside example" unless state
MSpec.actions :expectation, state
if NO_MATCHER_GIVEN.equal?(matcher)
SpecNegativeOperatorMatcher.new(self)
else