Module: Fix::Matcher Private
- Included in:
- Dsl
- Defined in:
- lib/fix/matcher.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Collection of expectation matchers.
Instance Method Summary collapse
-
#be(expected) ⇒ #matches?
(also: #equal)
Identity matcher.
-
#be_an_instance_of(expected) ⇒ #matches?
Type/class matcher.
-
#be_false ⇒ #matches?
False matcher.
-
#be_nil ⇒ #matches?
Nil matcher.
-
#be_true ⇒ #matches?
True matcher.
-
#be_within(delta) ⇒ #matches?
Comparisons matcher.
-
#change(object, method) ⇒ #matches?
Change matcher.
-
#eq(expected) ⇒ #matches?
(also: #eql)
Equivalence matcher.
-
#match(expected) ⇒ #matches?
Regular expressions matcher.
-
#raise_exception(expected) ⇒ #matches?
Expecting errors matcher.
-
#satisfy {|value| ... } ⇒ #matches?
Satisfy matcher.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name) ⇒ Object (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Predicate matcher, or default method missing behavior.
217 218 219 220 221 |
# File 'lib/fix/matcher.rb', line 217 def method_missing(name, ...) return super unless predicate_matcher_name?(name) ::Matchi::Predicate.new(name, ...) end |
Instance Method Details
#be(expected) ⇒ #matches? Also known as: equal
Identity matcher
41 42 43 |
# File 'lib/fix/matcher.rb', line 41 def be(expected) ::Matchi::Be.new(expected) end |
#be_an_instance_of(expected) ⇒ #matches?
Type/class matcher
155 156 157 |
# File 'lib/fix/matcher.rb', line 155 def be_an_instance_of(expected) ::Matchi::BeAnInstanceOf.new(expected) end |
#be_false ⇒ #matches?
False matcher
123 124 125 |
# File 'lib/fix/matcher.rb', line 123 def be_false be(false) end |
#be_nil ⇒ #matches?
Nil matcher
139 140 141 |
# File 'lib/fix/matcher.rb', line 139 def be_nil be(nil) end |
#be_true ⇒ #matches?
True matcher
107 108 109 |
# File 'lib/fix/matcher.rb', line 107 def be_true be(true) end |
#be_within(delta) ⇒ #matches?
Comparisons matcher
59 60 61 |
# File 'lib/fix/matcher.rb', line 59 def be_within(delta) ::Matchi::BeWithin.new(delta) end |
#change(object, method) ⇒ #matches?
Change matcher
188 189 190 |
# File 'lib/fix/matcher.rb', line 188 def change(object, method, ...) ::Matchi::Change.new(object, method, ...) end |
#eq(expected) ⇒ #matches? Also known as: eql
Equivalence matcher
22 23 24 |
# File 'lib/fix/matcher.rb', line 22 def eq(expected) ::Matchi::Eq.new(expected) end |
#match(expected) ⇒ #matches?
Regular expressions matcher
75 76 77 |
# File 'lib/fix/matcher.rb', line 75 def match(expected) ::Matchi::Match.new(expected) end |
#raise_exception(expected) ⇒ #matches?
Expecting errors matcher
91 92 93 |
# File 'lib/fix/matcher.rb', line 91 def raise_exception(expected) ::Matchi::RaiseException.new(expected) end |
#satisfy {|value| ... } ⇒ #matches?
Satisfy matcher
205 206 207 |
# File 'lib/fix/matcher.rb', line 205 def satisfy(&) ::Matchi::Satisfy.new(&) end |