Class: Matchi::Fix
- Inherits:
-
Object
- Object
- Matchi::Fix
- Defined in:
- lib/matchi/fix.rb
Overview
Fix matcher.
Instance Attribute Summary collapse
-
#expected ⇒ Proc
readonly
A set of specifications.
Instance Method Summary collapse
-
#initialize(&block) ⇒ Fix
constructor
Initialize the matcher with a block of specs.
-
#inspect ⇒ Object
A string containing a human-readable representation of the matcher.
-
#matches?(&block) ⇒ Boolean
Boolean comparison between the actual value and the expected specs.
-
#to_s ⇒ Object
Returns a string representing the matcher.
Constructor Details
Instance Attribute Details
#expected ⇒ Proc (readonly)
Returns A set of specifications.
10 11 12 |
# File 'lib/matchi/fix.rb', line 10 def expected @expected end |
Instance Method Details
#inspect ⇒ Object
A string containing a human-readable representation of the matcher.
45 46 47 |
# File 'lib/matchi/fix.rb', line 45 def inspect "#{self.class}(&specs)" end |
#matches?(&block) ⇒ Boolean
Boolean comparison between the actual value and the expected specs.
38 39 40 41 42 |
# File 'lib/matchi/fix.rb', line 38 def matches?(&block) expected.test(log_level: 0, &block) rescue ::SystemExit => e e.success? end |
#to_s ⇒ Object
Returns a string representing the matcher.
50 51 52 |
# File 'lib/matchi/fix.rb', line 50 def to_s "fix &specs" end |