class RSpec::Matchers::BuiltIn::Be

Public Class Methods

new(*args, &block) click to toggle source
# File lib/rspec/matchers/built_in/be.rb, line 49
def initialize(*args, &block)
  @args = args
end

Public Instance Methods

failure_message_for_should() click to toggle source
# File lib/rspec/matchers/built_in/be.rb, line 57
def failure_message_for_should
  "expected #{@actual.inspect} to evaluate to true"
end
failure_message_for_should_not() click to toggle source
# File lib/rspec/matchers/built_in/be.rb, line 61
def failure_message_for_should_not
  "expected #{@actual.inspect} to evaluate to false"
end
match(_, actual) click to toggle source
# File lib/rspec/matchers/built_in/be.rb, line 53
def match(_, actual)
  !!actual
end

Private Instance Methods

args_to_s() click to toggle source
# File lib/rspec/matchers/built_in/be.rb, line 73
def args_to_s
  @args.empty? ? "" : parenthesize(inspected_args.join(', '))
end
args_to_sentence() click to toggle source
# File lib/rspec/matchers/built_in/be.rb, line 89
def args_to_sentence
  to_sentence(@args)
end
expected_to_sentence() click to toggle source
# File lib/rspec/matchers/built_in/be.rb, line 85
def expected_to_sentence
  split_words(@expected)
end
inspected_args() click to toggle source
# File lib/rspec/matchers/built_in/be.rb, line 81
def inspected_args
  @args.collect{|a| a.inspect}
end
parenthesize(string) click to toggle source
# File lib/rspec/matchers/built_in/be.rb, line 77
def parenthesize(string)
  "(#{string})"
end