class BeOneAnd

Public Class Methods

new(matcher) click to toggle source
# File lib/itesttool/custom_matchers.rb, line 118
def initialize(matcher)
  @matcher = matcher
end

Public Instance Methods

failure_message_for_should() click to toggle source
# File lib/itesttool/custom_matchers.rb, line 132
def failure_message_for_should
  if @have_error 
    @have.failure_message_for_should
  else
    @matcher.failure_message_for_should
  end
end
matches?(rows) click to toggle source
# 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