Class: Matchi::BeTrue
- Inherits:
- BasicObject
- Defined in:
- lib/matchi/be_true.rb
Overview
Truth matcher.
Instance Method Summary collapse
-
#matches? ⇒ Boolean
Boolean comparison between the actual value and the expected value.
-
#to_h ⇒ Hash
Returns a hash of one key-value pair with a key corresponding to the matcher and a value corresponding to its initialize parameters.
-
#to_s ⇒ String
Returns a string representing the matcher.
Instance Method Details
#matches? ⇒ Boolean
Boolean comparison between the actual value and the expected value.
13 14 15 |
# File 'lib/matchi/be_true.rb', line 13 def matches? true.equal?(yield) end |
#to_h ⇒ Hash
Returns a hash of one key-value pair with a key corresponding to the
matcher and a value corresponding to its initialize parameters.
36 37 38 |
# File 'lib/matchi/be_true.rb', line 36 def to_h { BeTrue: [] } end |
#to_s ⇒ String
Returns a string representing the matcher.
24 25 26 |
# File 'lib/matchi/be_true.rb', line 24 def to_s 'be_true' end |