Module: RSpec::ChangeToNow::Matchers::DSL
- Includes:
- Detect
- Included in:
- Matchers::BuiltIn::Change, Matchers::BuiltIn::ChangeFromValue
- Defined in:
- lib/rspec/change_to_now/matchers/dsl.rb
Defined Under Namespace
Modules: Detect
Instance Method Summary collapse
-
#as_matcher(expected) ⇒ Object
Returns a matcher that behaves like the
matcher
if passed a matcher, otherwise like match(matcher
). -
#matcher_only(matcher) ⇒ Object
Returns a new matcher that fails with a syntax error if
matcher
is not a matcher but otherwise behaves just likematcher
. -
#negate(matcher) ⇒ Object
Returns a matcher that behaves like the inverse of
matcher
.
Methods included from Detect
Instance Method Details
#as_matcher(expected) ⇒ Object
Returns a matcher that behaves like the matcher
if passed a matcher, otherwise like match(matcher
)
16 17 18 |
# File 'lib/rspec/change_to_now/matchers/dsl.rb', line 16 def as_matcher(expected) RSpec::ChangeToNow::Matchers::AsMatcher.new(expected) end |
#matcher_only(matcher) ⇒ Object
Returns a new matcher that fails with a syntax error if matcher
is not a matcher but otherwise behaves just like matcher
.
4 5 6 |
# File 'lib/rspec/change_to_now/matchers/dsl.rb', line 4 def matcher_only(matcher) RSpec::ChangeToNow::Matchers::MatcherOnly.new(matcher) end |
#negate(matcher) ⇒ Object
Returns a matcher that behaves like the inverse of matcher
.
10 11 12 |
# File 'lib/rspec/change_to_now/matchers/dsl.rb', line 10 def negate(matcher) RSpec::ChangeToNow::Matchers::Negate.new(matcher) end |