class RTest::Expect

Attributes

failure_message[R]
passing_message[R]

Public Class Methods

new(object) click to toggle source
# File lib/rtest/expect.rb, line 6
def initialize(object)
  @object = object
end

Public Instance Methods

not_to(matcher) click to toggle source
# File lib/rtest/expect.rb, line 18
def not_to(matcher)
  if(matcher.match?(@object)) then @failure_message = matcher.failure_message_for_not_to
  else
    @passing_message = matcher.success_message_for_not_to
    @pass = true
  end
end
pass?() click to toggle source
# File lib/rtest/expect.rb, line 26
def pass?
  @pass
end
to(matcher) click to toggle source
# File lib/rtest/expect.rb, line 10
def to(matcher)
  if(matcher.match?(@object)) 
    @pass = true
    @passing_message = matcher.success_message_for_to
  else @failure_message = matcher.failure_message_for_to
  end
end