Class Index [+]

Quicksearch

RSpec::Matchers::BuiltIn::BeComparedTo

Public Class Methods

new(operand, operator) click to toggle source
    # File lib/rspec/matchers/built_in/be.rb, line 92
92:         def initialize(operand, operator)
93:           @expected, @operator = operand, operator
94:             @args = []
95:         end

Public Instance Methods

description() click to toggle source
     # File lib/rspec/matchers/built_in/be.rb, line 117
117:         def description
118:           "be #{@operator} #{expected_to_sentence}#{args_to_sentence}"
119:         end
failure_message_for_should() click to toggle source
     # File lib/rspec/matchers/built_in/be.rb, line 102
102:         def failure_message_for_should
103:           "expected: #{@operator} #{@expected.inspect}\n     got: #{@operator.to_s.gsub(/./, ' ')} #{@actual.inspect}"
104:         end
failure_message_for_should_not() click to toggle source
     # File lib/rspec/matchers/built_in/be.rb, line 106
106:         def failure_message_for_should_not
107:           message = 'should_not be #{@operator} #{@expected}' not only FAILED,it is a bit confusing.
108: 
109:           raise message << ([:===,:==].include?(@operator) ?
110:                             "It might be more clearly expressed without the \"be\"?" :
111:                             "It might be more clearly expressed in the positive?")
112:         end
matches?(actual) click to toggle source
     # File lib/rspec/matchers/built_in/be.rb, line 97
 97:         def matches?(actual)
 98:           @actual = actual
 99:           @actual.__send__(@operator, @expected)
100:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.