Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rubygem-rspec-mocks for openSUSE:Factory checked in at 2023-02-18 17:10:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-rspec-mocks (Old) and /work/SRC/openSUSE:Factory/.rubygem-rspec-mocks.new.22824 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-rspec-mocks" Sat Feb 18 17:10:05 2023 rev:26 rq:1058914 version:3.12.3 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-rspec-mocks/rubygem-rspec-mocks.changes 2022-12-04 14:58:02.132160058 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-rspec-mocks.new.22824/rubygem-rspec-mocks.changes 2023-02-18 17:10:06.514630991 +0100 @@ -1,0 +2,21 @@ +Tue Jan 17 11:04:31 UTC 2023 - Dan Äermák <dcer...@suse.com> + +- New upstream release 3.12.3 + + Bug Fixes: + + * Fix keyword delegation in `send` for verifying doubles on Ruby 3. + (Charlie Honig, #1485) + +------------------------------------------------------------------- +Mon Jan 9 16:05:50 UTC 2023 - Martin Vidner <mvid...@suse.com> + +- updated to version 3.12.2 + + Notable bug fix, for bsc#1206419: + + Fix keyword argument assertions when mocking using with on Ruby + 3.2.0. (Slava Kardakov, Benoit Tigeot, Phil Pirozhkov, Benoit + Daloze, #1514) + +------------------------------------------------------------------- Old: ---- rspec-mocks-3.12.0.gem New: ---- rspec-mocks-3.12.3.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-rspec-mocks.spec ++++++ --- /var/tmp/diff_new_pack.LxbhH4/_old 2023-02-18 17:10:08.486643443 +0100 +++ /var/tmp/diff_new_pack.LxbhH4/_new 2023-02-18 17:10:08.518643645 +0100 @@ -1,7 +1,7 @@ # # spec file for package rubygem-rspec-mocks # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,29 +16,27 @@ # +%define mod_name rspec-mocks +%define mod_full_name %{mod_name}-%{version} # # This file was generated with a gem2rpm.yml and not just plain gem2rpm. # All sections marked as MANUAL, license headers, summaries and descriptions # can be maintained in that file. Please consult this file before editing any # of those fields # - Name: rubygem-rspec-mocks -Version: 3.12.0 +Version: 3.12.3 Release: 0 -%define mod_name rspec-mocks -%define mod_full_name %{mod_name}-%{version} -BuildRoot: %{_tmppath}/%{name}-%{version}-build +Summary: RSpec's 'test double' framework, with support for stubbing and mocking +License: MIT +Group: Development/Languages/Ruby +URL: https://github.com/rspec/rspec-mocks +Source: https://rubygems.org/gems/%{mod_full_name}.gem +Source1: gem2rpm.yml BuildRequires: %{ruby >= 1.8.7} BuildRequires: %{rubygem gem2rpm} BuildRequires: %{rubygem rdoc > 3.10} BuildRequires: ruby-macros >= 5 -URL: https://github.com/rspec/rspec-mocks -Source: https://rubygems.org/gems/%{mod_full_name}.gem -Source1: gem2rpm.yml -Summary: RSpec's 'test double' framework, with support for stubbing and mocking -License: MIT -Group: Development/Languages/Ruby %description RSpec's 'test double' framework, with support for stubbing and mocking. ++++++ rspec-mocks-3.12.0.gem -> rspec-mocks-3.12.3.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Changelog.md new/Changelog.md --- old/Changelog.md 2022-10-26 21:14:46.000000000 +0200 +++ new/Changelog.md 2023-01-17 01:38:02.000000000 +0100 @@ -1,5 +1,38 @@ ### Development -[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.0...3-12-maintenance) +[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.3...3-12-maintenance) + +### 3.12.3 / 2023-01-17 +[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.2...v3.12.3) + +Bug Fixes: + +* Fix keyword delegation in `send` for verifying doubles on Ruby 3. + (Charlie Honig, #1485) + +### 3.12.2 / 2023-01-07 +[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.1...v3.12.2) + +Bug Fixes: + +* Fix implementation blocks for mocks using keyword arguments on Ruby 3.2.0. + (Adam Steel, #1508) +* Fix keyword argument assertions when mocking using `with` on Ruby 3.2.0. + (Slava Kardakov, Benoit Tigeot, Phil Pirozhkov, Benoit Daloze, #1514) + +### 3.12.1 / 2022-12-10 +[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.0...v3.12.1) + +Bug Fixes: + +* Remove empty diff marker when a diff only contains console codes. (Jon Rowe, #1506) +* Show keyword vs hash diff marker when arguments are not `==` (Jon Rowe, #1506) +* Change check to detect frozen objects to rescue errors rather than + pre-empting by checking `frozen?` due to some objects mis-behaving. + (Keegan Roth, #1401) +* Prevent unfulfilled expectations using `expect_any_instance_of` across a class + inheritance boundary from raising rather than failing. (Jon Rowe, #1496) +* Prevent a misleading error message when using `allow(...).not_to` with + unsupported matchers. (Phil Pirozhkov, #1503) ### 3.12.0 / 2022-10-26 [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.11.2...v3.12.0) 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/message_chains.rb new/lib/rspec/mocks/any_instance/message_chains.rb --- old/lib/rspec/mocks/any_instance/message_chains.rb 2022-10-26 21:14:46.000000000 +0200 +++ new/lib/rspec/mocks/any_instance/message_chains.rb 2023-01-17 01:38:02.000000000 +0100 @@ -49,7 +49,7 @@ # @private def unfulfilled_expectations @chains_by_method_name.map do |method_name, chains| - method_name.to_s if ExpectationChain === chains.last unless chains.last.expectation_fulfilled? + method_name.to_s if ExpectationChain === chains.last && !chains.last.expectation_fulfilled? end.compact end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rspec/mocks/any_instance/proxy.rb new/lib/rspec/mocks/any_instance/proxy.rb --- old/lib/rspec/mocks/any_instance/proxy.rb 2022-10-26 21:14:46.000000000 +0200 +++ new/lib/rspec/mocks/any_instance/proxy.rb 2023-01-17 01:38:02.000000000 +0100 @@ -10,7 +10,7 @@ # # This proxy sits in front of the recorder and delegates both to it # and to the `RSpec::Mocks::Proxy` for each already mocked or stubbed - # instance of the class, in order to propogates changes to the instances. + # instance of the class, in order to propagates changes to the instances. # # Note that unlike `RSpec::Mocks::Proxy`, this proxy class is stateless # and is not persisted in `RSpec::Mocks.space`. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rspec/mocks/argument_list_matcher.rb new/lib/rspec/mocks/argument_list_matcher.rb --- old/lib/rspec/mocks/argument_list_matcher.rb 2022-10-26 21:14:46.000000000 +0200 +++ new/lib/rspec/mocks/argument_list_matcher.rb 2023-01-17 01:38:02.000000000 +0100 @@ -61,7 +61,9 @@ return false if expected_args.size != actual_args.size if RUBY_VERSION >= "3" - # if both arguments end with Hashes, and if one is a keyword hash and the other is not, they don't match + # If the expectation was set with keywords, while the actual method was called with a positional hash argument, they don't match. + # If the expectation was set without keywords, e.g., with({a: 1}), then it fine to call it with either foo(a: 1) or foo({a: 1}). + # This corresponds to Ruby semantics, as if the method was def foo(options). if Hash === expected_args.last && Hash === actual_args.last if !Hash.ruby2_keywords_hash?(actual_args.last) && Hash.ruby2_keywords_hash?(expected_args.last) return false 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 2022-10-26 21:14:46.000000000 +0200 +++ new/lib/rspec/mocks/error_generator.rb 2023-01-17 01:38:02.000000000 +0100 @@ -269,13 +269,19 @@ expected_args = format_args(expectation.expected_args) actual_args = format_received_args(args_for_multiple_calls) - if RSpec::Support::RubyFeatures.distincts_kw_args_from_positional_hash? && expected_args == actual_args + if RSpec::Support::RubyFeatures.distincts_kw_args_from_positional_hash? expected_hash = expectation.expected_args.last actual_hash = args_for_multiple_calls.last.last if Hash === expected_hash && Hash === actual_hash && (Hash.ruby2_keywords_hash?(expected_hash) != Hash.ruby2_keywords_hash?(actual_hash)) - actual_args += Hash.ruby2_keywords_hash?(actual_hash) ? " (keyword arguments)" : " (options hash)" - expected_args += Hash.ruby2_keywords_hash?(expected_hash) ? " (keyword arguments)" : " (options hash)" + + actual_description = Hash.ruby2_keywords_hash?(actual_hash) ? " (keyword arguments)" : " (options hash)" + expected_description = Hash.ruby2_keywords_hash?(expected_hash) ? " (keyword arguments)" : " (options hash)" + + if actual_description != expected_description + actual_args += actual_description + expected_args += expected_description + end end end @@ -283,7 +289,11 @@ if args_for_multiple_calls.one? diff = diff_message(expectation.expected_args, args_for_multiple_calls.first) - message << "\nDiff:#{diff}" unless diff.strip.empty? + if RSpec::Mocks.configuration.color? + message << "\nDiff:#{diff}" unless diff.gsub(/\e\[\d+m/, '').strip.empty? + else + message << "\nDiff:#{diff}" unless diff.strip.empty? + end end message diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rspec/mocks/matchers/have_received.rb new/lib/rspec/mocks/matchers/have_received.rb --- old/lib/rspec/mocks/matchers/have_received.rb 2022-10-26 21:14:46.000000000 +0200 +++ new/lib/rspec/mocks/matchers/have_received.rb 2023-01-17 01:38:02.000000000 +0100 @@ -16,7 +16,7 @@ @subject = nil end - def name + def matcher_name "have_received" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rspec/mocks/matchers/receive.rb new/lib/rspec/mocks/matchers/receive.rb --- old/lib/rspec/mocks/matchers/receive.rb 2022-10-26 21:14:46.000000000 +0200 +++ new/lib/rspec/mocks/matchers/receive.rb 2023-01-17 01:38:02.000000000 +0100 @@ -13,7 +13,7 @@ @recorded_customizations = [] end - def name + def matcher_name "receive" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rspec/mocks/matchers/receive_message_chain.rb new/lib/rspec/mocks/matchers/receive_message_chain.rb --- old/lib/rspec/mocks/matchers/receive_message_chain.rb 2022-10-26 21:14:46.000000000 +0200 +++ new/lib/rspec/mocks/matchers/receive_message_chain.rb 2023-01-17 01:38:02.000000000 +0100 @@ -20,7 +20,7 @@ end end - def name + def matcher_name "receive_message_chain" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rspec/mocks/matchers/receive_messages.rb new/lib/rspec/mocks/matchers/receive_messages.rb --- old/lib/rspec/mocks/matchers/receive_messages.rb 2022-10-26 21:14:46.000000000 +0200 +++ new/lib/rspec/mocks/matchers/receive_messages.rb 2023-01-17 01:38:02.000000000 +0100 @@ -10,7 +10,7 @@ @backtrace_line = CallerFilter.first_non_rspec_line end - def name + def matcher_name "receive_messages" 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 2022-10-26 21:14:46.000000000 +0200 +++ new/lib/rspec/mocks/method_double.rb 2023-01-17 01:38:02.000000000 +0100 @@ -2,6 +2,9 @@ module Mocks # @private class MethodDouble + # @private TODO: drop in favor of FrozenError in ruby 2.5+ + FROZEN_ERROR_MSG = /can't modify frozen/ + # @private attr_reader :method_name, :object, :expectations, :stubs, :method_stasher @@ -70,6 +73,14 @@ end @method_is_proxied = true + rescue RuntimeError, TypeError => e + # TODO: drop in favor of FrozenError in ruby 2.5+ + # RuntimeError (and FrozenError) for ruby 2.x + # TypeError for ruby 1.x + if (defined?(FrozenError) && e.is_a?(FrozenError)) || FROZEN_ERROR_MSG === e.message + raise ArgumentError, "Cannot proxy frozen objects, rspec-mocks relies on proxies for method stubbing and expectations." + end + raise end # The implementation of the proxied method. Subclasses may override this @@ -83,7 +94,6 @@ # @private def restore_original_method - return show_frozen_warning if object_singleton_class.frozen? return unless @method_is_proxied remove_method_from_definition_target @@ -91,6 +101,14 @@ restore_original_visibility @method_is_proxied = false + rescue RuntimeError, TypeError => e + # TODO: drop in favor of FrozenError in ruby 2.5+ + # RuntimeError (and FrozenError) for ruby 2.x + # TypeError for ruby 1.x + if (defined?(FrozenError) && e.is_a?(FrozenError)) || FROZEN_ERROR_MSG === e.message + return show_frozen_warning + end + raise end # @private diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rspec/mocks/minitest_integration.rb new/lib/rspec/mocks/minitest_integration.rb --- old/lib/rspec/mocks/minitest_integration.rb 2022-10-26 21:14:46.000000000 +0200 +++ new/lib/rspec/mocks/minitest_integration.rb 2023-01-17 01:38:02.000000000 +0100 @@ -37,7 +37,7 @@ # not want to here (or else we would interfere with rspec-expectations' definition). else # ...otherwise, define those methods now. If `rspec/expectations/minitest_integration` - # is loaded after this file, it'll overide the defintion here. + # is loaded after this file, it'll override the definition here. Minitest::Expectation.class_eval do include RSpec::Mocks::ExpectationTargetMethods 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 2022-10-26 21:14:46.000000000 +0200 +++ new/lib/rspec/mocks/mutate_const.rb 2023-01-17 01:38:02.000000000 +0100 @@ -81,7 +81,7 @@ # Queries rspec-mocks to find out information about the named constant. # # @param [String] name the name of the constant - # @return [Constant] an object contaning information about the named + # @return [Constant] an object containing information about the named # constant. def self.original(name) mutator = ::RSpec::Mocks.space.constant_mutator_for(name) 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 2022-10-26 21:14:46.000000000 +0200 +++ new/lib/rspec/mocks/proxy.rb 2023-01-17 01:38:02.000000000 +0100 @@ -35,15 +35,9 @@ # @private def ensure_can_be_proxied!(object) - return unless object.is_a?(Symbol) || object.frozen? - return if object.nil? + return unless object.is_a?(Symbol) - msg = "Cannot proxy frozen objects" - if Symbol === object - msg << ". Symbols such as #{object} cannot be mocked or stubbed." - else - msg << ", rspec-mocks relies on proxies for method stubbing and expectations." - end + msg = "Cannot proxy frozen objects. Symbols such as #{object} cannot be mocked or stubbed." raise ArgumentError, msg end @@ -198,6 +192,7 @@ @messages_received << [message, args, block] end end + ruby2_keywords :record_message_received if respond_to?(:ruby2_keywords, true) # @private def message_received(message, *args, &block) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rspec/mocks/targets.rb new/lib/rspec/mocks/targets.rb --- old/lib/rspec/mocks/targets.rb 2022-10-26 21:14:46.000000000 +0200 +++ new/lib/rspec/mocks/targets.rb 2023-01-17 01:38:02.000000000 +0100 @@ -54,7 +54,7 @@ def raise_negation_unsupported(method_name, matcher) raise NegationUnsupportedError, - "`#{expression}(...).#{method_name} #{matcher.name}` is not supported since it " \ + "`#{expression}(...).#{method_name} #{matcher.matcher_name}` is not supported since it " \ "doesn't really make sense. What would it even mean?" end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rspec/mocks/verifying_double.rb new/lib/rspec/mocks/verifying_double.rb --- old/lib/rspec/mocks/verifying_double.rb 2022-10-26 21:14:46.000000000 +0200 +++ new/lib/rspec/mocks/verifying_double.rb 2023-01-17 01:38:02.000000000 +0100 @@ -42,11 +42,13 @@ ensure @__sending_message = nil end + ruby2_keywords :__send__ if respond_to?(:ruby2_keywords, true) $VERBOSE = old def send(name, *args, &block) __send__(name, *args, &block) end + ruby2_keywords :send if respond_to?(:ruby2_keywords, true) def initialize(doubled_module, *args) @doubled_module = doubled_module 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 2022-10-26 21:14:46.000000000 +0200 +++ new/lib/rspec/mocks/verifying_proxy.rb 2023-01-17 01:38:02.000000000 +0100 @@ -57,7 +57,7 @@ # A verifying proxy mostly acts like a normal proxy, except that it # contains extra logic to try and determine the validity of any expectation # set on it. This includes whether or not methods have been defined and the - # validatiy of arguments on method calls. + # validity of arguments on method calls. # # In all other ways this behaves like a normal proxy. It only adds the # verification behaviour to specific methods then delegates to the parent @@ -147,12 +147,12 @@ end def add_expectation(*args, &block) - # explict params necessary for 1.8.7 see #626 + # explicit params necessary for 1.8.7 see #626 super(*args, &block).tap { |x| x.method_reference = @method_reference } end def add_stub(*args, &block) - # explict params necessary for 1.8.7 see #626 + # explicit params necessary for 1.8.7 see #626 super(*args, &block).tap { |x| x.method_reference = @method_reference } end @@ -160,6 +160,7 @@ validate_arguments!(args) super end + ruby2_keywords :proxy_method_invoked if respond_to?(:ruby2_keywords, true) def validate_arguments!(actual_args) @method_reference.with_signature do |signature| 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 2022-10-26 21:14:46.000000000 +0200 +++ new/lib/rspec/mocks/version.rb 2023-01-17 01:38:02.000000000 +0100 @@ -3,7 +3,7 @@ # Version information for RSpec mocks. module Version # Version of RSpec mocks currently in use in SemVer format. - STRING = '3.12.0' + STRING = '3.12.3' end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2022-10-26 21:14:46.000000000 +0200 +++ new/metadata 2023-01-17 01:38:02.000000000 +0100 @@ -1,13 +1,13 @@ --- !ruby/object:Gem::Specification name: rspec-mocks version: !ruby/object:Gem::Version - version: 3.12.0 + version: 3.12.3 platform: ruby authors: - Steven Baker - David Chelimsky - Myron Marston -autorequire: +autorequire: bindir: bin cert_chain: - | @@ -45,7 +45,7 @@ ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ F3MdtaDehhjC -----END CERTIFICATE----- -date: 2022-10-26 00:00:00.000000000 Z +date: 2023-01-17 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rspec-support @@ -194,11 +194,11 @@ - MIT metadata: bug_tracker_uri: https://github.com/rspec/rspec-mocks/issues - changelog_uri: https://github.com/rspec/rspec-mocks/blob/v3.12.0/Changelog.md + changelog_uri: https://github.com/rspec/rspec-mocks/blob/v3.12.3/Changelog.md documentation_uri: https://rspec.info/documentation/ mailing_list_uri: https://groups.google.com/forum/#!forum/rspec source_code_uri: https://github.com/rspec/rspec-mocks -post_install_message: +post_install_message: rdoc_options: - "--charset=UTF-8" require_paths: @@ -214,8 +214,8 @@ - !ruby/object:Gem::Version version: '0' requirements: [] -rubygems_version: 3.1.6 -signing_key: +rubygems_version: 3.3.26 +signing_key: specification_version: 4 -summary: rspec-mocks-3.12.0 +summary: rspec-mocks-3.12.3 test_files: [] Binary files old/metadata.gz.sig and new/metadata.gz.sig differ