Class Index [+]

Quicksearch

Spec::Matchers::BeComparedTo

Public Class Methods

new(operand, operator) click to toggle source
    # File lib/spec/matchers/be.rb, line 88
88:       def initialize(operand, operator)
89:         @expected, @operator = operand, operator
90:         @args = []
91:       end

Public Instance Methods

description() click to toggle source
     # File lib/spec/matchers/be.rb, line 113
113:       def description
114:         "be #{@operator} #{expected_to_sentence}#{args_to_sentence}"
115:       end
failure_message_for_should() click to toggle source
     # File lib/spec/matchers/be.rb, line 98
 98:       def failure_message_for_should
 99:         "expected #{@operator} #{@expected}, got #{@actual.inspect}"
100:       end
failure_message_for_should_not() click to toggle source
     # File lib/spec/matchers/be.rb, line 102
102:       def failure_message_for_should_not
103:         message = 'should_not be #{@operator} #{@expected}' not only FAILED,it is a bit confusing.
104:           
105:         raise message << ([:===,:==].include?(@operator) ?
106:           "It might be more clearly expressed without the \"be\"?" :
107:           "It might be more clearly expressed in the positive?")
108:       end
matches?(actual) click to toggle source
    # File lib/spec/matchers/be.rb, line 93
93:       def matches?(actual)
94:         @actual = actual
95:         @actual.__send__(@operator, @expected)
96:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.