Parent

Included Modules

Matchy::Expectations::OperatorExpectation

Class to handle operator expectations.

Examples

  
  13.should == 13
  "hello".length.should_not == 2

Public Class Methods

new(receiver, match) click to toggle source
    # File lib/matchy/built_in/operator_expectations.rb, line 13
13:       def initialize(receiver, match)
14:         @receiver, @match = receiver, match
15:       end

Protected Instance Methods

fail!(operator) click to toggle source
    # File lib/matchy/built_in/operator_expectations.rb, line 29
29:       def fail!(operator)
30:         flunk @match ? failure_message(operator) : negative_failure_message(operator)
31:       end
failure_message(operator) click to toggle source
    # File lib/matchy/built_in/operator_expectations.rb, line 33
33:       def failure_message(operator)
34:         "Expected #{@receiver.inspect} to #{operator} #{@expected.inspect}."
35:       end
negative_failure_message(operator) click to toggle source
    # File lib/matchy/built_in/operator_expectations.rb, line 37
37:       def negative_failure_message(operator)
38:         "Expected #{@receiver.inspect} to not #{operator} #{@expected.inspect}."
39:       end
pass!() click to toggle source
    # File lib/matchy/built_in/operator_expectations.rb, line 25
25:       def pass!
26:         defined?($current_test_case) ? $current_test_case.assert(true) : (assert true)
27:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.