Class: RSpec::Matchers::BuiltIn::OperatorMatcher Private

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/matchers/built_in/operators.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Provides the implementation for operator matchers. Not intended to be instantiated directly. Only available for use with should.

Instance Method Summary (collapse)

Constructor Details

- (OperatorMatcher) initialize(actual)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of OperatorMatcher

41
42
43
# File 'lib/rspec/matchers/built_in/operators.rb', line 41
def initialize(actual)
  @actual = actual
end

Instance Method Details

- (String) description

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)
76
77
78
# File 'lib/rspec/matchers/built_in/operators.rb', line 76
def description
  "#{@operator} #{RSpec::Support::ObjectFormatter.format(@expected)}"
end