lib/spectus/expectation_target.rb in spectus-3.2.0 vs lib/spectus/expectation_target.rb in spectus-3.3.0

- old
+ new

@@ -17,26 +17,27 @@ # This word, or the terms "REQUIRED" or "SHALL", mean that the # definition is an absolute requirement of the specification. # # @example _Absolute requirement_ definition - # it { 'foo'.upcase }.MUST eql 'FOO' + # it { "foo".upcase }.MUST eql 'FOO' # # @param matcher [#matches?] The matcher. # - # @return [Expresenter::Fail, Expresenter::Pass] Report if the spec pass or fail. + # @return [Spectus::Result::Fail, Spectus::Result::Pass] Report if the spec + # pass or fail. def MUST(matcher) RequirementLevel::Must.new( callable: callable, isolation: false, negate: false, matcher: matcher ).call end # @example _Absolute requirement_ definition with isolation - # it { 'foo'.upcase }.MUST! eql 'FOO' + # it { "foo".upcase }.MUST! eql 'FOO' # # @see MUST def MUST!(matcher) RequirementLevel::Must.new( callable: callable, @@ -48,26 +49,27 @@ # This phrase, or the phrase "SHALL NOT", mean that the # definition is an absolute prohibition of the specification. # # @example _Absolute prohibition_ definition - # it { 'foo'.size }.MUST_NOT equal 42 + # it { "foo".size }.MUST_NOT equal 42 # # @param matcher [#matches?] The matcher. # - # @return [Expresenter::Fail, Expresenter::Pass] Report if the spec pass or fail. + # @return [Spectus::Result::Fail, Spectus::Result::Pass] Report if the spec + # pass or fail. def MUST_NOT(matcher) RequirementLevel::Must.new( callable: callable, isolation: false, negate: true, matcher: matcher ).call end # @example _Absolute prohibition_ definition with isolation - # it { 'foo'.size }.MUST_NOT! equal 42 + # it { "foo".size }.MUST_NOT! equal 42 # # @see MUST_NOT def MUST_NOT!(matcher) RequirementLevel::Must.new( callable: callable, @@ -81,26 +83,27 @@ # may exist valid reasons in particular circumstances to ignore a # particular item, but the full implications must be understood and # carefully weighed before choosing a different course. # # @example _Recommended_ definition - # it { 'foo'.valid_encoding? }.SHOULD equal true + # it { "foo".valid_encoding? }.SHOULD equal true # # @param matcher [#matches?] The matcher. # - # @return [Expresenter::Fail, Expresenter::Pass] Report if the spec pass or fail. + # @return [Spectus::Result::Fail, Spectus::Result::Pass] Report if the spec + # pass or fail. def SHOULD(matcher) RequirementLevel::Should.new( callable: callable, isolation: false, negate: false, matcher: matcher ).call end # @example _Recommended_ definition with isolation - # it { 'foo'.valid_encoding? }.SHOULD! equal true + # it { "foo".valid_encoding? }.SHOULD! equal true # # @see SHOULD def SHOULD!(matcher) RequirementLevel::Should.new( callable: callable, @@ -115,26 +118,27 @@ # particular behavior is acceptable or even useful, but the full # implications should be understood and the case carefully weighed # before implementing any behavior described with this label. # # @example _Not recommended_ definition - # it { ''.blank? }.SHOULD_NOT raise_exception NoMethodError + # it { "".blank? }.SHOULD_NOT raise_exception NoMethodError # # @param matcher [#matches?] The matcher. # - # @return [Expresenter::Fail, Expresenter::Pass] Report if the spec pass or fail. + # @return [Spectus::Result::Fail, Spectus::Result::Pass] Report if the spec + # pass or fail. def SHOULD_NOT(matcher) RequirementLevel::Should.new( callable: callable, isolation: false, negate: true, matcher: matcher ).call end # @example _Not recommended_ definition with isolation - # it { ''.blank? }.SHOULD_NOT! raise_exception NoMethodError + # it { "".blank? }.SHOULD_NOT! raise_exception NoMethodError # # @see SHOULD_NOT def SHOULD_NOT!(matcher) RequirementLevel::Should.new( callable: callable, @@ -155,25 +159,25 @@ # MUST be prepared to interoperate with another implementation which # does not include the option (except, of course, for the feature the # option provides.) # # @example _Optional_ definition - # it { 'foo'.bar }.MAY match /^foo$/ + # it { "foo".bar }.MAY match /^foo$/ # # @param matcher [#matches?] The matcher. # - # @return [Expresenter::Fail, Expresenter::Pass] Report if the spec pass or fail. + # @return [Spectus::Result::Fail, Spectus::Result::Pass] Report if the spec pass or fail. def MAY(matcher) RequirementLevel::May.new( callable: callable, isolation: false, negate: false, matcher: matcher ).call end # @example _Optional_ definition with isolation - # it { 'foo'.bar }.MAY! match /^foo$/ + # it { "foo".bar }.MAY! match /^foo$/ # # @see MAY def MAY!(matcher) RequirementLevel::May.new( callable: callable,