Class: BeOneAnd
- Inherits:
-
Object
- Object
- BeOneAnd
- Defined in:
- lib/itesttool/custom_matchers.rb
Instance Method Summary collapse
- #failure_message_for_should ⇒ Object
-
#initialize(matcher) ⇒ BeOneAnd
constructor
A new instance of BeOneAnd.
- #matches?(rows) ⇒ Boolean
Constructor Details
#initialize(matcher) ⇒ BeOneAnd
Returns a new instance of BeOneAnd.
118 119 120 |
# File 'lib/itesttool/custom_matchers.rb', line 118 def initialize(matcher) @matcher = matcher end |
Instance Method Details
#failure_message_for_should ⇒ Object
132 133 134 135 136 137 138 |
# File 'lib/itesttool/custom_matchers.rb', line 132 def if @have_error @have. else @matcher. end end |
#matches?(rows) ⇒ Boolean
122 123 124 125 126 127 128 129 130 |
# File 'lib/itesttool/custom_matchers.rb', line 122 def matches?(rows) @have_error = false @have = RSpec::Matchers::BuiltIn::Have.new(1).items unless @have.matches? rows then @have_error = true return false; end @matcher.matches? rows[0] end |