Hello community,
here is the log from the commit of package rubygem-rspec-mocks for
openSUSE:Factory checked in at 2017-05-27 13:11:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-rspec-mocks (Old)
and /work/SRC/openSUSE:Factory/.rubygem-rspec-mocks.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-rspec-mocks"
Sat May 27 13:11:32 2017 rev:15 rq:497693 version:3.6.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-rspec-mocks/rubygem-rspec-mocks.changes
2016-07-16 22:11:18.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-rspec-mocks.new/rubygem-rspec-mocks.changes
2017-05-27 13:11:34.057165325 +0200
@@ -1,0 +2,36 @@
+Tue May 23 10:17:49 UTC 2017 - [email protected]
+
+- updated to version 3.6.0
+ see installed Changelog.md
+
+ ### 3.6.0 / 2017-05-04
+ [Full
Changelog](http://github.com/rspec/rspec-mocks/compare/v3.6.0.beta2...v3.6.0)
+
+ Bug Fixes:
+
+ * Fix "instance variable @color not initialized" warning when using
+ rspec-mocks without rspec-core. (Myron Marston, #1142)
+ * Restore aliased module methods properly when stubbing on 1.8.7.
+ (Samuel Giddins, #1144)
+ * Allow a message chain expectation to be constrained by argument(s).
+ (Jon Rowe, #1156)
+
+ ### 3.6.0.beta2 / 2016-12-12
+ [Full
Changelog](http://github.com/rspec/rspec-mocks/compare/v3.6.0.beta1...v3.6.0.beta2)
+
+ Enhancements:
+
+ * Add new `without_partial_double_verification { }` API that lets you
+ temporarily turn off partial double verification for an example.
+ (Jon Rowe, #1104)
+
+ ### 3.6.0.beta1 / 2016-10-09
+ [Full
Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0...v3.6.0.beta1)
+
+ Bug Fixes:
+
+ * Return the test double instance form `#freeze` (Alessandro Berardi, #1109)
+ * Allow the special logic for stubbing `new` to work when `<Class>.method`
has
+ been redefined. (Proby, #1119)
+
+-------------------------------------------------------------------
Old:
----
rspec-mocks-3.5.0.gem
New:
----
rspec-mocks-3.6.0.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-rspec-mocks.spec ++++++
--- /var/tmp/diff_new_pack.NcylVN/_old 2017-05-27 13:11:34.613086727 +0200
+++ /var/tmp/diff_new_pack.NcylVN/_new 2017-05-27 13:11:34.617086162 +0200
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-rspec-mocks
#
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
#
Name: rubygem-rspec-mocks
-Version: 3.5.0
+Version: 3.6.0
Release: 0
%define mod_name rspec-mocks
%define mod_full_name %{mod_name}-%{version}
++++++ rspec-mocks-3.5.0.gem -> rspec-mocks-3.6.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Changelog.md new/Changelog.md
--- old/Changelog.md 2016-07-01 17:46:30.000000000 +0200
+++ new/Changelog.md 2017-05-05 01:58:58.000000000 +0200
@@ -1,3 +1,33 @@
+### 3.6.0 / 2017-05-04
+[Full
Changelog](http://github.com/rspec/rspec-mocks/compare/v3.6.0.beta2...v3.6.0)
+
+Bug Fixes:
+
+* Fix "instance variable @color not initialized" warning when using
+ rspec-mocks without rspec-core. (Myron Marston, #1142)
+* Restore aliased module methods properly when stubbing on 1.8.7.
+ (Samuel Giddins, #1144)
+* Allow a message chain expectation to be constrained by argument(s).
+ (Jon Rowe, #1156)
+
+### 3.6.0.beta2 / 2016-12-12
+[Full
Changelog](http://github.com/rspec/rspec-mocks/compare/v3.6.0.beta1...v3.6.0.beta2)
+
+Enhancements:
+
+* Add new `without_partial_double_verification { }` API that lets you
+ temporarily turn off partial double verification for an example.
+ (Jon Rowe, #1104)
+
+### 3.6.0.beta1 / 2016-10-09
+[Full
Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0...v3.6.0.beta1)
+
+Bug Fixes:
+
+* Return the test double instance form `#freeze` (Alessandro Berardi, #1109)
+* Allow the special logic for stubbing `new` to work when `<Class>.method` has
+ been redefined. (Proby, #1119)
+
### 3.5.0 / 2016-07-01
[Full
Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0.beta4...v3.5.0)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2016-07-01 17:46:30.000000000 +0200
+++ new/README.md 2017-05-05 01:58:58.000000000 +0200
@@ -101,6 +101,21 @@
order.calculate_total_price(double(:price => 1.99), double(:price => 2.99))
```
+### Stubbing a chain of methods
+
+You can use `receive_message_chain` in place of `receive` to stub a chain of
messages:
+
+```ruby
+allow(double).to receive_message_chain("foo.bar") { :baz }
+allow(double).to receive_message_chain(:foo, :bar => :baz)
+allow(double).to receive_message_chain(:foo, :bar) { :baz }
+
+# Given any of the above forms:
+double.foo.bar # => :baz
+```
+
+Chains can be arbitrarily long, which makes it quite painless to violate the
Law of Demeter in violent ways, so you should consider any use of
`receive_message_chain` a code smell. Even though not all code smells indicate
real problems (think fluent interfaces), `receive_message_chain` still results
in brittle examples. For example, if you write `allow(foo).to
receive_message_chain(:bar, :baz => 37)` in a spec and then the implementation
calls `foo.baz.bar`, the stub will not work.
+
## Consecutive return values
When a stub might be invoked more than once, you can provide additional
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
Binary files old/checksums.yaml.gz.sig and new/checksums.yaml.gz.sig differ
Binary files old/data.tar.gz.sig and new/data.tar.gz.sig differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/mocks/any_instance/expect_chain_chain.rb
new/lib/rspec/mocks/any_instance/expect_chain_chain.rb
--- old/lib/rspec/mocks/any_instance/expect_chain_chain.rb 2016-07-01
17:46:30.000000000 +0200
+++ new/lib/rspec/mocks/any_instance/expect_chain_chain.rb 2017-05-05
01:58:58.000000000 +0200
@@ -23,11 +23,7 @@
end
def invocation_order
- @invocation_order ||= {
- :and_return => [nil],
- :and_raise => [nil],
- :and_yield => [nil]
- }
+ EmptyInvocationOrder
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/mocks/any_instance/expectation_chain.rb
new/lib/rspec/mocks/any_instance/expectation_chain.rb
--- old/lib/rspec/mocks/any_instance/expectation_chain.rb 2016-07-01
17:46:30.000000000 +0200
+++ new/lib/rspec/mocks/any_instance/expectation_chain.rb 2017-05-05
01:58:58.000000000 +0200
@@ -35,12 +35,14 @@
me
end
- def invocation_order
- @invocation_order ||= {
- :with => [nil],
+ ExpectationInvocationOrder =
+ {
:and_return => [:with, nil],
- :and_raise => [:with, nil]
- }
+ :and_raise => [:with, nil],
+ }.freeze
+
+ def invocation_order
+ ExpectationInvocationOrder
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/mocks/any_instance/stub_chain.rb
new/lib/rspec/mocks/any_instance/stub_chain.rb
--- old/lib/rspec/mocks/any_instance/stub_chain.rb 2016-07-01
17:46:30.000000000 +0200
+++ new/lib/rspec/mocks/any_instance/stub_chain.rb 2017-05-05
01:58:58.000000000 +0200
@@ -25,20 +25,24 @@
stub
end
- def invocation_order
- @invocation_order ||= {
- :with => [nil],
+ InovcationOrder =
+ {
:and_return => [:with, nil],
:and_raise => [:with, nil],
:and_yield => [:with, :and_yield, nil],
:and_throw => [:with, nil],
:and_call_original => [:with, nil],
:and_wrap_original => [:with, nil]
- }
+ }.freeze
+
+ EmptyInvocationOrder = {}.freeze
+
+ def invocation_order
+ InovcationOrder
end
def verify_invocation_order(rspec_method_name, *_args, &_block)
- return if invocation_order[rspec_method_name].include?(last_message)
+ return if invocation_order.fetch(rspec_method_name,
[nil]).include?(last_message)
raise NoMethodError, "Undefined method #{rspec_method_name}"
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/mocks/any_instance/stub_chain_chain.rb
new/lib/rspec/mocks/any_instance/stub_chain_chain.rb
--- old/lib/rspec/mocks/any_instance/stub_chain_chain.rb 2016-07-01
17:46:30.000000000 +0200
+++ new/lib/rspec/mocks/any_instance/stub_chain_chain.rb 2017-05-05
01:58:58.000000000 +0200
@@ -15,12 +15,7 @@
end
def invocation_order
- @invocation_order ||= {
- :with => [nil],
- :and_return => [nil],
- :and_raise => [nil],
- :and_yield => [nil]
- }
+ EmptyInvocationOrder
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/mocks/configuration.rb
new/lib/rspec/mocks/configuration.rb
--- old/lib/rspec/mocks/configuration.rb 2016-07-01 17:46:30.000000000
+0200
+++ new/lib/rspec/mocks/configuration.rb 2017-05-05 01:58:58.000000000
+0200
@@ -8,6 +8,8 @@
@verify_doubled_constant_names = false
@transfer_nested_constants = false
@verify_partial_doubles = false
+ @temporarily_suppress_partial_double_verification = false
+ @color = false
end
# Sets whether RSpec will warn, ignore, or fail a test when
@@ -153,6 +155,11 @@
@verify_partial_doubles
end
+ # @private
+ # Used to track wether we are temporarily suppressing verifying partial
+ # doubles with `without_partial_double_verification { ... }`
+ attr_accessor :temporarily_suppress_partial_double_verification
+
if ::RSpec.respond_to?(:configuration)
def color?
::RSpec.configuration.color_enabled?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/mocks/error_generator.rb
new/lib/rspec/mocks/error_generator.rb
--- old/lib/rspec/mocks/error_generator.rb 2016-07-01 17:46:30.000000000
+0200
+++ new/lib/rspec/mocks/error_generator.rb 2017-05-05 01:58:58.000000000
+0200
@@ -214,8 +214,8 @@
def expectation_on_nil_message(method_name)
"An expectation of `:#{method_name}` was set on `nil`. " \
- "To allow expectations on `nil` and suppress this message, set
`config.allow_message_expectations_on_nil` to `true`. " \
- "To disallow expectations on `nil`, set
`config.allow_message_expectations_on_nil` to `false`"
+ "To allow expectations on `nil` and suppress this message, set
`RSpec::Mocks.configuration.allow_message_expectations_on_nil` to `true`. " \
+ "To disallow expectations on `nil`, set
`RSpec::Mocks.configuration.allow_message_expectations_on_nil` to `false`"
end
# @private
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/mocks/example_methods.rb
new/lib/rspec/mocks/example_methods.rb
--- old/lib/rspec/mocks/example_methods.rb 2016-07-01 17:46:30.000000000
+0200
+++ new/lib/rspec/mocks/example_methods.rb 2017-05-05 01:58:58.000000000
+0200
@@ -282,6 +282,18 @@
Matchers::HaveReceived.new(method_name, &block)
end
+ # Turns off the verifying of partial doubles for the duration of the
+ # block, this is useful in situations where methods are defined at run
+ # time and you wish to define stubs for them but not turn off partial
+ # doubles for the entire run suite. (e.g. view specs in rspec-rails).
+ def without_partial_double_verification
+ original_state =
Mocks.configuration.temporarily_suppress_partial_double_verification
+ Mocks.configuration.temporarily_suppress_partial_double_verification =
true
+ yield
+ ensure
+ Mocks.configuration.temporarily_suppress_partial_double_verification =
original_state
+ end
+
# @method expect
# Used to wrap an object in preparation for setting a mock expectation
# on it.
@@ -380,7 +392,7 @@
def self.included(klass)
klass.class_exec do
# This gets mixed in so that if `RSpec::Matchers` is included in
- # `klass` later, it's definition of `expect` will take precedence.
+ # `klass` later, its definition of `expect` will take precedence.
include ExpectHost unless method_defined?(:expect)
end
end
@@ -388,7 +400,7 @@
# @private
def self.extended(object)
# This gets extended in so that if `RSpec::Matchers` is included in
- # `klass` later, it's definition of `expect` will take precedence.
+ # `klass` later, its definition of `expect` will take precedence.
object.extend ExpectHost unless object.respond_to?(:expect)
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/mocks/instance_method_stasher.rb
new/lib/rspec/mocks/instance_method_stasher.rb
--- old/lib/rspec/mocks/instance_method_stasher.rb 2016-07-01
17:46:30.000000000 +0200
+++ new/lib/rspec/mocks/instance_method_stasher.rb 2017-05-05
01:58:58.000000000 +0200
@@ -128,6 +128,17 @@
# Hence, we verify that the owner actually has the method defined.
# If the given owner does not have the method defined, we assume
# that the method is actually owned by @klass.
+ #
+ # On 1.8, aliased methods can also report the wrong owner. Example:
+ # module M
+ # def a; end
+ # module_function :a
+ # alias b a
+ # module_function :b
+ # end
+ # The owner of M.b is the raw Module object, instead of the expected
+ # singleton class of the module
+ return true if RUBY_VERSION < '1.9' && owner == @object
owner == @klass || !(method_defined_on_klass?(owner))
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/mocks/message_expectation.rb
new/lib/rspec/mocks/message_expectation.rb
--- old/lib/rspec/mocks/message_expectation.rb 2016-07-01 17:46:30.000000000
+0200
+++ new/lib/rspec/mocks/message_expectation.rb 2017-05-05 01:58:58.000000000
+0200
@@ -330,7 +330,7 @@
def ordered(&block)
if type == :stub
RSpec.warning(
- "`allow(...).to receive(..).ordered` is not supported and will" \
+ "`allow(...).to receive(..).ordered` is not supported and will " \
"have no effect, use `and_return(*ordered_values)` instead."
)
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/mocks/method_double.rb
new/lib/rspec/mocks/method_double.rb
--- old/lib/rspec/mocks/method_double.rb 2016-07-01 17:46:30.000000000
+0200
+++ new/lib/rspec/mocks/method_double.rb 2017-05-05 01:58:58.000000000
+0200
@@ -207,8 +207,8 @@
# In Ruby 2.0.0 and above prepend will alter the method lookup chain.
# We use an object's singleton class to define method doubles upon,
- # however if the object has had it's singleton class (as opposed to
- # it's actual class) prepended too then the the method lookup chain
+ # however if the object has had its singleton class (as opposed to
+ # its actual class) prepended too then the the method lookup chain
# will look in the prepended module first, **before** the singleton
# class.
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/mocks/method_reference.rb
new/lib/rspec/mocks/method_reference.rb
--- old/lib/rspec/mocks/method_reference.rb 2016-07-01 17:46:30.000000000
+0200
+++ new/lib/rspec/mocks/method_reference.rb 2017-05-05 01:58:58.000000000
+0200
@@ -189,7 +189,7 @@
# We only want to apply our special logic to normal `new` methods.
# Methods that the user has monkeyed with should be left as-is.
- klass.method(:new).owner == ::Class
+ ::RSpec::Support.method_handle_for(klass, :new).owner == ::Class
end
def with_signature
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/mocks/mutate_const.rb
new/lib/rspec/mocks/mutate_const.rb
--- old/lib/rspec/mocks/mutate_const.rb 2016-07-01 17:46:30.000000000 +0200
+++ new/lib/rspec/mocks/mutate_const.rb 2017-05-05 01:58:58.000000000 +0200
@@ -105,6 +105,10 @@
# so you can stub constants in other contexts (e.g. helper
# classes).
def self.stub(constant_name, value, options={})
+ unless String === constant_name
+ raise ArgumentError, "`stub_const` requires a String, but you
provided a #{constant_name.class.name}"
+ end
+
mutator = if recursive_const_defined?(constant_name,
&raise_on_invalid_const)
DefinedConstantReplacer
else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/mocks/proxy.rb new/lib/rspec/mocks/proxy.rb
--- old/lib/rspec/mocks/proxy.rb 2016-07-01 17:46:31.000000000 +0200
+++ new/lib/rspec/mocks/proxy.rb 2017-05-05 01:58:58.000000000 +0200
@@ -439,11 +439,6 @@
super
end
- def add_negative_message_expectation(location, method_name,
&implementation)
- warn_or_raise!(method_name)
- super
- end
-
def add_stub(method_name, opts={}, &implementation)
warn_or_raise!(method_name)
super
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/mocks/test_double.rb
new/lib/rspec/mocks/test_double.rb
--- old/lib/rspec/mocks/test_double.rb 2016-07-01 17:46:31.000000000 +0200
+++ new/lib/rspec/mocks/test_double.rb 2017-05-05 01:58:58.000000000 +0200
@@ -66,6 +66,7 @@
# doubles.
def freeze
RSpec.warn_with("WARNING: you attempted to freeze a test double. This
is explicitly a no-op as freezing doubles can lead to undesired behaviour when
resetting tests.")
+ self
end
private
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/mocks/verifying_proxy.rb
new/lib/rspec/mocks/verifying_proxy.rb
--- old/lib/rspec/mocks/verifying_proxy.rb 2016-07-01 17:46:31.000000000
+0200
+++ new/lib/rspec/mocks/verifying_proxy.rb 2017-05-05 01:58:58.000000000
+0200
@@ -120,6 +120,11 @@
optional_callback_invocation_strategy.call(@doubled_module)
end
+ def ensure_implemented(_method_name)
+ return if
Mocks.configuration.temporarily_suppress_partial_double_verification
+ super
+ end
+
def method_reference
@method_doubles
end
@@ -193,6 +198,8 @@
def self.for(object, method_name, proxy)
if ClassNewMethodReference.applies_to?(method_name) { object }
VerifyingExistingClassNewMethodDouble
+ elsif
Mocks.configuration.temporarily_suppress_partial_double_verification
+ MethodDouble
else
self
end.new(object, method_name, proxy)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/mocks/version.rb
new/lib/rspec/mocks/version.rb
--- old/lib/rspec/mocks/version.rb 2016-07-01 17:46:31.000000000 +0200
+++ new/lib/rspec/mocks/version.rb 2017-05-05 01:58:58.000000000 +0200
@@ -3,7 +3,7 @@
# Version information for RSpec mocks.
module Version
# Version of RSpec mocks currently in use in SemVer format.
- STRING = '3.5.0'
+ STRING = '3.6.0'
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2016-07-01 17:46:30.000000000 +0200
+++ new/metadata 2017-05-05 01:58:58.000000000 +0200
@@ -1,7 +1,7 @@
--- !ruby/object:Gem::Specification
name: rspec-mocks
version: !ruby/object:Gem::Version
- version: 3.5.0
+ version: 3.6.0
platform: ruby
authors:
- Steven Baker
@@ -45,7 +45,7 @@
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
F3MdtaDehhjC
-----END CERTIFICATE-----
-date: 2016-07-01 00:00:00.000000000 Z
+date: 2017-05-04 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: rspec-support
@@ -53,14 +53,14 @@
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: 3.5.0
+ version: 3.6.0
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: 3.5.0
+ version: 3.6.0
- !ruby/object:Gem::Dependency
name: diff-lcs
requirement: !ruby/object:Gem::Requirement
@@ -210,9 +210,9 @@
version: '0'
requirements: []
rubyforge_project:
-rubygems_version: 2.5.1
+rubygems_version: 2.4.5.2
signing_key:
specification_version: 4
-summary: rspec-mocks-3.5.0
+summary: rspec-mocks-3.6.0
test_files: []
has_rdoc:
Binary files old/metadata.gz.sig and new/metadata.gz.sig differ