rspec-mocks 3.5.0.beta1 → 3.5.0.beta2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5342aa85d00e6bcc24d8debc05333f12d40b7ad
4
- data.tar.gz: e4082539be10ac57f42759854b84d9bc8c4c15d8
3
+ metadata.gz: 04c6f5ba70d371c519038204d10781a53a3c6f70
4
+ data.tar.gz: 621501f526471f9156e29b0a74a78b42779b5b10
5
5
  SHA512:
6
- metadata.gz: e5afda5c6811e7b3db5bb83b4957c5864d74a45fcc16fb9e84a8378d5dfb05c8eede815317fc6a6bbeb0cc378552d81837e7ed7e0c12a30b8838b512a8d9eef9
7
- data.tar.gz: 177e8c07f662fa0a7b3a115218c50836aa5afe1da19c2bf679ab833dbe9041b048eac179b463cf9a8de385039f13a5133c7bf44a779fb2ad4329419b17745d24
6
+ metadata.gz: 08c1dff465c3965b39ac0cac32171dc5706657ab792d84083de15d49487159be7c8b00ba2825009a673351e0e6506903748c3569aa2cc39f9eba47bf1c37874e
7
+ data.tar.gz: 0bec2879051701ddaa9d971ac3e56e1ec3456a69cbffd55c120e587d1507748d7ab292db3f768b7758f47359ef759f80b683e70c73c6b0efc5d11e11693b27ba
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,6 +1,16 @@
1
1
  ### Development
2
2
  [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0.beta1...master)
3
3
 
4
+ Enhancements:
5
+
6
+ * Improve error message displayed when using `and_wrap_original` on pure test
7
+ doubles. (betesh, #1063)
8
+
9
+ Bug Fixes:
10
+
11
+ * Fix issue that prevented `receive_message_chain(...).with(...)` working
12
+ correctly on "any instance" mocks. (Jon Rowe, #1061)
13
+
4
14
  ### 3.5.0.beta1 / 2016-02-06
5
15
  [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.4.1...v3.5.0.beta1)
6
16
 
@@ -12,6 +22,8 @@ Bug Fixes:
12
22
  `allow`. (Andrew Kozin, #1056)
13
23
  * Prevent stubbing `respond_to?` on partial doubles from causing infinite
14
24
  recursion. (Jon Rowe, #1013)
25
+ * Prevent aliased methods from disapearing after being mocked with
26
+ `any_instance` (regression from #1043). (Joe Rafaniello, #1060)
15
27
 
16
28
  ### 3.4.1 / 2016-01-10
17
29
  [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.4.0...v3.4.1)
@@ -16,6 +16,7 @@ module RSpec
16
16
 
17
17
  def invocation_order
18
18
  @invocation_order ||= {
19
+ :with => [nil],
19
20
  :and_return => [nil],
20
21
  :and_raise => [nil],
21
22
  :and_yield => [nil]
@@ -95,7 +95,7 @@ module RSpec
95
95
  # counter.increment
96
96
  # expect(counter.count).to eq(original_count + 1)
97
97
  def and_call_original
98
- and_wrap_original do |original, *args, &block|
98
+ wrap_original(__method__) do |original, *args, &block|
99
99
  original.call(*args, &block)
100
100
  end
101
101
  end
@@ -113,15 +113,7 @@ module RSpec
113
113
  # original_method.call(*args, &block).first(10)
114
114
  # end
115
115
  def and_wrap_original(&block)
116
- if RSpec::Mocks::TestDouble === @method_double.object
117
- @error_generator.raise_only_valid_on_a_partial_double(:and_call_original)
118
- else
119
- warn_about_stub_override if implementation.inner_action
120
- @implementation = AndWrapOriginalImplementation.new(@method_double.original_implementation_callable, block)
121
- @yield_receiver_to_implementation_block = false
122
- end
123
-
124
- nil
116
+ wrap_original(__method__, &block)
125
117
  end
126
118
 
127
119
  # @overload and_raise
@@ -601,6 +593,18 @@ module RSpec
601
593
  "Called from #{CallerFilter.first_non_rspec_line}."
602
594
  )
603
595
  end
596
+
597
+ def wrap_original(method_name, &block)
598
+ if RSpec::Mocks::TestDouble === @method_double.object
599
+ @error_generator.raise_only_valid_on_a_partial_double(method_name)
600
+ else
601
+ warn_about_stub_override if implementation.inner_action
602
+ @implementation = AndWrapOriginalImplementation.new(@method_double.original_implementation_callable, block)
603
+ @yield_receiver_to_implementation_block = false
604
+ end
605
+
606
+ nil
607
+ end
604
608
  end
605
609
 
606
610
  include ImplementationDetails
@@ -3,7 +3,7 @@ module RSpec
3
3
  # Version information for RSpec mocks.
4
4
  module Version
5
5
  # Version of RSpec mocks currently in use in SemVer format.
6
- STRING = '3.5.0.beta1'
6
+ STRING = '3.5.0.beta2'
7
7
  end
8
8
  end
9
9
  end
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: 3.5.0.beta1
4
+ version: 3.5.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Baker
@@ -45,7 +45,7 @@ cert_chain:
45
45
  ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
46
46
  F3MdtaDehhjC
47
47
  -----END CERTIFICATE-----
48
- date: 2016-02-06 00:00:00.000000000 Z
48
+ date: 2016-03-10 00:00:00.000000000 Z
49
49
  dependencies:
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: rspec-support
@@ -53,14 +53,14 @@ dependencies:
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 3.5.0.beta1
56
+ version: 3.5.0.beta2
57
57
  type: :runtime
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 3.5.0.beta1
63
+ version: 3.5.0.beta2
64
64
  - !ruby/object:Gem::Dependency
65
65
  name: diff-lcs
66
66
  requirement: !ruby/object:Gem::Requirement
@@ -209,9 +209,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  version: 1.3.1
210
210
  requirements: []
211
211
  rubyforge_project:
212
- rubygems_version: 2.4.5.1
212
+ rubygems_version: 2.5.1
213
213
  signing_key:
214
214
  specification_version: 4
215
- summary: rspec-mocks-3.5.0.beta1
215
+ summary: rspec-mocks-3.5.0.beta2
216
216
  test_files: []
217
217
  has_rdoc:
metadata.gz.sig CHANGED
Binary file