rspec-mocks 2.99.1 → 2.99.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Changelog.md +8 -0
- data/lib/rspec/mocks/argument_matchers.rb +12 -0
- data/lib/rspec/mocks/version.rb +1 -1
- data/spec/rspec/mocks/matchers/receive_spec.rb +11 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1af49965a5c6d2286b6fda243d7b3a509da5fcd
|
4
|
+
data.tar.gz: d17b57235eee4d62ee17c5152f1398f68e0a6890
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfb8b04b091d883bd624058e475d9efeb92d528bec14069699a4af5916305f9d04d970a58d13bf1d6be342470ef84f92f81b0f47980abb7d035d78990a383f1f
|
7
|
+
data.tar.gz: f7ba1ce85e44a85ad5543f750bf1ab5df3b14665868f01dbfc41c7037da944d1c8e30a01ad01efc4711275d2010152c78bc72f7da4001a4814a6194201683373
|
data/Changelog.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
### 2.99.2 / 2014-07-21
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v2.99.1...v2.99.2)
|
3
|
+
|
4
|
+
Enhancements:
|
5
|
+
|
6
|
+
* Warn about upcoming change to `#===` matching and `DateTime#===` behaviour.
|
7
|
+
(Jon Rowe, #735)
|
8
|
+
|
1
9
|
### 2.99.1 / 2014-06-12
|
2
10
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v2.99.0...v2.99.1)
|
3
11
|
|
@@ -109,6 +109,18 @@ module RSpec
|
|
109
109
|
end
|
110
110
|
|
111
111
|
def ==(expected)
|
112
|
+
if defined?(DateTime) && DateTime === expected
|
113
|
+
RSpec.warn_deprecation <<-WARN.gsub(/^\s*\|/,'')
|
114
|
+
|In RSpec 3.0.0 matchers use `#===` (the match operator) to perform
|
115
|
+
|comparision between expected and actual arguments. Due to strange
|
116
|
+
|behaviour with `DateTime#===` (which ignores the time of the object
|
117
|
+
|when performing a comparison) this may result in undesired
|
118
|
+
|behaviour. We recommend you switch to a `Date` or `Time` object
|
119
|
+
|instead.
|
120
|
+
|
|
121
|
+
|Called from: #{RSpec::CallerFilter.first_non_rspec_line}
|
122
|
+
WARN
|
123
|
+
end
|
112
124
|
@given == expected
|
113
125
|
end
|
114
126
|
end
|
data/lib/rspec/mocks/version.rb
CHANGED
@@ -28,6 +28,17 @@ module RSpec
|
|
28
28
|
}.to raise_error(/received :foo with unexpected arguments/)
|
29
29
|
end
|
30
30
|
|
31
|
+
it 'warns about the change to === in RSpec 3 when used with a DateTime' do
|
32
|
+
wrapped.to receive(:foo).with(DateTime.new(2014,1,1,1))
|
33
|
+
allow_deprecation
|
34
|
+
receiver.foo(DateTime.new(2014,1,1,1))
|
35
|
+
|
36
|
+
expect {
|
37
|
+
expect_warn_deprecation_with_call_site __FILE__, __LINE__ + 1
|
38
|
+
receiver.foo(DateTime.new(2014,1,1,2))
|
39
|
+
}.to raise_error(/received :foo with unexpected arguments/)
|
40
|
+
end
|
41
|
+
|
31
42
|
it 'allows a `do...end` block implementation to be provided' do
|
32
43
|
wrapped.to receive(:foo) do
|
33
44
|
4
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-mocks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.99.
|
4
|
+
version: 2.99.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Baker
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-07-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -221,7 +221,7 @@ rubyforge_project: rspec
|
|
221
221
|
rubygems_version: 2.2.2
|
222
222
|
signing_key:
|
223
223
|
specification_version: 4
|
224
|
-
summary: rspec-mocks-2.99.
|
224
|
+
summary: rspec-mocks-2.99.2
|
225
225
|
test_files:
|
226
226
|
- features/README.md
|
227
227
|
- features/Scope.md
|