# File lib/rspec/matchers/built_in/be.rb, line 95 def initialize(operand, operator) @expected, @operator = operand, operator @args = [] end
# File lib/rspec/matchers/built_in/be.rb, line 120 def description "be #{@operator} #{expected_to_sentence}#{args_to_sentence}" end
# File lib/rspec/matchers/built_in/be.rb, line 105 def failure_message_for_should "expected: #{@operator} #{@expected.inspect}\n got: #{@operator.to_s.gsub(/./, ' ')} #{@actual.inspect}" end
# File lib/rspec/matchers/built_in/be.rb, line 109 def failure_message_for_should_not message = "'should_not be #{@operator} #{@expected}' not only FAILED, it is a bit confusing. " raise message << ([:===,:==].include?(@operator) ? "It might be more clearly expressed without the \"be\"?" : "It might be more clearly expressed in the positive?") end
# File lib/rspec/matchers/built_in/be.rb, line 100 def matches?(actual) @actual = actual @actual.send @operator, @expected end