Class: RSpec::Mocks::ArgumentMatchers::EqualityProxy
- Inherits:
-
Object
- Object
- RSpec::Mocks::ArgumentMatchers::EqualityProxy
- Defined in:
- lib/rspec/mocks/argument_matchers.rb
Instance Method Summary collapse
- #==(expected) ⇒ Object
-
#initialize(given) ⇒ EqualityProxy
constructor
A new instance of EqualityProxy.
Constructor Details
#initialize(given) ⇒ EqualityProxy
Returns a new instance of EqualityProxy.
107 108 109 |
# File 'lib/rspec/mocks/argument_matchers.rb', line 107 def initialize(given) @given = given end |
Instance Method Details
#==(expected) ⇒ Object
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/rspec/mocks/argument_matchers.rb', line 111 def ==(expected) if defined?(DateTime) && DateTime === expected RSpec.warn_deprecation <<-WARN.gsub(/^\s*\|/,'') |In RSpec 3.0.0 matchers use `#===` (the match operator) to perform |comparision between expected and actual arguments. Due to strange |behaviour with `DateTime#===` (which ignores the time of the object |when performing a comparison) this may result in undesired |behaviour. We recommend you switch to a `Date` or `Time` object |instead. | |Called from: #{RSpec::CallerFilter.first_non_rspec_line} WARN end @given == expected end |