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 2022-02-28 19:43:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-rspec-mocks (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-rspec-mocks.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-rspec-mocks"

Mon Feb 28 19:43:08 2022 rev:23 rq:956455 version:3.11.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-rspec-mocks/rubygem-rspec-mocks.changes  
2021-02-11 12:45:41.173340268 +0100
+++ 
/work/SRC/openSUSE:Factory/.rubygem-rspec-mocks.new.1958/rubygem-rspec-mocks.changes
        2022-02-28 19:43:11.657932882 +0100
@@ -1,0 +2,7 @@
+Mon Feb 21 11:36:36 UTC 2022 - Stephan Kulow <co...@suse.com>
+
+updated to version 3.11.0
+ see installed Changelog.md
+
+
+-------------------------------------------------------------------

Old:
----
  rspec-mocks-3.10.2.gem

New:
----
  rspec-mocks-3.11.0.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-rspec-mocks.spec ++++++
--- /var/tmp/diff_new_pack.YLYkJR/_old  2022-02-28 19:43:12.201933086 +0100
+++ /var/tmp/diff_new_pack.YLYkJR/_new  2022-02-28 19:43:12.205933087 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package rubygem-rspec-mocks
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # 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.10.2
+Version:        3.11.0
 Release:        0
 %define mod_name rspec-mocks
 %define mod_full_name %{mod_name}-%{version}

++++++ rspec-mocks-3.10.2.gem -> rspec-mocks-3.11.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Changelog.md new/Changelog.md
--- old/Changelog.md    2021-01-29 00:09:23.000000000 +0100
+++ new/Changelog.md    2022-02-09 12:37:06.000000000 +0100
@@ -1,5 +1,22 @@
 ### Development
-[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.2...main)
+[Full 
Changelog](http://github.com/rspec/rspec-mocks/compare/v3.11.0...3-11-maintenance)
+
+### 3.11.0 / 2022-02-09
+[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.3...v3.11.0)
+
+Enhancements:
+
+* Add `and_invoke` implementation for configuring responses to `receive`
+  (and `receive_messages`) with multiple callable objects. (Kyle Smith, #1411)
+
+### 3.10.3 / 2022-01-28
+[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.2...v3.10.3)
+
+Bug Fixes:
+
+* Suppress warning by setting `$VERBOSE` to nil. (Nobuyoshi Nakada, #1414)
+* Support keyword argument semantics when constraining argument expectations 
using
+  `with` on Ruby 3.0+ (Yusuke Endoh, #1394)
 
 ### 3.10.2 / 2021-01-27
 [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.1...v3.10.2)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md       2021-01-29 00:09:23.000000000 +0100
+++ new/README.md       2022-02-09 12:37:06.000000000 +0100
@@ -1,4 +1,4 @@
-# RSpec Mocks [![Build 
Status](https://github.com/rspec/rspec-mocks/workflows/RSpec%20CI/badge.svg?branch=3-10-maintenance)](https://github.com/rspec/rspec-mocks/actions)
 [![Code 
Climate](https://codeclimate.com/github/rspec/rspec-mocks.svg)](https://codeclimate.com/github/rspec/rspec-mocks)
+# RSpec Mocks [![Build 
Status](https://github.com/rspec/rspec-mocks/workflows/RSpec%20CI/badge.svg)](https://github.com/rspec/rspec-mocks/actions)
 [![Code 
Climate](https://codeclimate.com/github/rspec/rspec-mocks.svg)](https://codeclimate.com/github/rspec/rspec-mocks)
 rspec-mocks is a test-double framework for rspec with support for method stubs,
 fakes, and message expectations on generated test-doubles and real objects
 alike.
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/argument_list_matcher.rb 
new/lib/rspec/mocks/argument_list_matcher.rb
--- old/lib/rspec/mocks/argument_list_matcher.rb        2021-01-29 
00:09:23.000000000 +0100
+++ new/lib/rspec/mocks/argument_list_matcher.rb        2022-02-09 
12:37:06.000000000 +0100
@@ -46,16 +46,30 @@
         @expected_args = expected_args
         ensure_expected_args_valid!
       end
+      ruby2_keywords :initialize if 
Module.private_method_defined?(:ruby2_keywords)
 
       # @api public
-      # @param [Array] args
+      # @param [Array] actual_args
       #
       # Matches each element in the `expected_args` against the element in the 
same
       # position of the arguments passed to `new`.
       #
       # @see #initialize
-      def args_match?(*args)
-        
Support::FuzzyMatcher.values_match?(resolve_expected_args_based_on(args), args)
+      def args_match?(*actual_args)
+        expected_args = resolve_expected_args_based_on(actual_args)
+
+        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 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
+            end
+          end
+        end
+
+        Support::FuzzyMatcher.values_match?(expected_args, actual_args)
       end
 
       # @private
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     2021-01-29 00:09:23.000000000 
+0100
+++ new/lib/rspec/mocks/matchers/receive.rb     2022-02-09 12:37:06.000000000 
+0100
@@ -62,6 +62,7 @@
             @recorded_customizations << ExpectationCustomization.new(method, 
args, block)
             self
           end
+          ruby2_keywords(method) if 
Module.private_method_defined?(:ruby2_keywords)
         end
 
       private
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       2021-01-29 
00:09:23.000000000 +0100
+++ new/lib/rspec/mocks/matchers/receive_message_chain.rb       2022-02-09 
12:37:06.000000000 +0100
@@ -13,7 +13,7 @@
           @recorded_customizations  = []
         end
 
-        [:with, :and_return, :and_throw, :and_raise, :and_yield, 
:and_call_original].each do |msg|
+        [:with, :and_return, :and_invoke, :and_throw, :and_raise, :and_yield, 
:and_call_original].each do |msg|
           define_method(msg) do |*args, &block|
             @recorded_customizations << ExpectationCustomization.new(msg, 
args, block)
             self
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  2021-01-29 00:09:23.000000000 
+0100
+++ new/lib/rspec/mocks/message_expectation.rb  2022-02-09 12:37:06.000000000 
+0100
@@ -53,7 +53,7 @@
       # etc.
       #
       # If the message is received more times than there are values, the last
-      # value is received for every subsequent call.
+      # value is returned for every subsequent call.
       #
       # @return [nil] No further chaining is supported after this.
       # @example
@@ -85,6 +85,48 @@
         nil
       end
 
+      # Tells the object to invoke a Proc when it receives the message. Given
+      # more than one value, the result of the first Proc is returned the first
+      # time the message is received, the result of the second Proc is returned
+      # the next time, etc, etc.
+      #
+      # If the message is received more times than there are Procs, the result 
of
+      # the last Proc is returned for every subsequent call.
+      #
+      # @return [nil] No further chaining is supported after this.
+      # @example
+      #   allow(api).to receive(:get_foo).and_invoke(-> { raise ApiTimeout })
+      #   api.get_foo # => raises ApiTimeout
+      #   api.get_foo # => raises ApiTimeout
+      #
+      #   allow(api).to receive(:get_foo).and_invoke(-> { raise ApiTimeout }, 
-> { raise ApiTimeout }, -> { :a_foo })
+      #   api.get_foo # => raises ApiTimeout
+      #   api.get_foo # => rasies ApiTimeout
+      #   api.get_foo # => :a_foo
+      #   api.get_foo # => :a_foo
+      #   api.get_foo # => :a_foo
+      #   # etc
+      def and_invoke(first_proc, *procs)
+        raise_already_invoked_error_if_necessary(__method__)
+        if negative?
+          raise "`and_invoke` is not supported with negative message 
expectations"
+        end
+
+        if block_given?
+          raise ArgumentError, "Implementation blocks aren't supported with 
`and_invoke`"
+        end
+
+        procs.unshift(first_proc)
+        if procs.any? { |p| !p.respond_to?(:call) }
+          raise ArgumentError, "Arguments to `and_invoke` must be callable."
+        end
+
+        @expected_received_count = [@expected_received_count, procs.size].max 
unless ignoring_args? || (@expected_received_count == 0 && @at_least)
+        self.terminal_implementation_action = 
AndInvokeImplementation.new(procs)
+
+        nil
+      end
+
       # Tells the object to delegate to the original unmodified method
       # when it receives the message.
       #
@@ -322,6 +364,7 @@
         @argument_list_matcher = ArgumentListMatcher.new(*args)
         self
       end
+      ruby2_keywords(:with) if Module.private_method_defined?(:ruby2_keywords)
 
       # Expect messages to be received in a specific order.
       #
@@ -683,6 +726,24 @@
       end
     end
 
+    # Handles the implementation of an `and_invoke` implementation.
+    # @private
+    class AndInvokeImplementation
+      def initialize(procs_to_invoke)
+        @procs_to_invoke = procs_to_invoke
+      end
+
+      def call(*args, &block)
+        proc = if @procs_to_invoke.size > 1
+                 @procs_to_invoke.shift
+               else
+                 @procs_to_invoke.first
+               end
+
+        proc.call(*args, &block)
+      end
+    end
+
     # Represents a configured implementation. Takes into account
     # any number of sub-implementations.
     # @private
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     2021-01-29 00:09:23.000000000 
+0100
+++ new/lib/rspec/mocks/verifying_double.rb     2022-02-09 12:37:06.000000000 
+0100
@@ -34,23 +34,15 @@
         super
       end
 
-      # @private
-      module SilentIO
-        def self.method_missing(*); end
-        def self.respond_to?(*)
-          true
-        end
-      end
-
       # Redefining `__send__` causes ruby to issue a warning.
-      old, $stderr = $stderr, SilentIO
+      old, $VERBOSE = $VERBOSE, nil
       def __send__(name, *args, &block)
         @__sending_message = name
         super
       ensure
         @__sending_message = nil
       end
-      $stderr = old
+      $VERBOSE = old
 
       def send(name, *args, &block)
         __send__(name, *args, &block)
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      2021-01-29 00:09:23.000000000 +0100
+++ new/lib/rspec/mocks/version.rb      2022-02-09 12:37:06.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.10.2'
+      STRING = '3.11.0'
     end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2021-01-29 00:09:23.000000000 +0100
+++ new/metadata        2022-02-09 12:37:06.000000000 +0100
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: rspec-mocks
 version: !ruby/object:Gem::Version
-  version: 3.10.2
+  version: 3.11.0
 platform: ruby
 authors:
 - Steven Baker
@@ -45,7 +45,7 @@
   ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
   F3MdtaDehhjC
   -----END CERTIFICATE-----
-date: 2021-01-28 00:00:00.000000000 Z
+date: 2022-02-09 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: rspec-support
@@ -53,14 +53,14 @@
     requirements:
     - - "~>"
       - !ruby/object:Gem::Version
-        version: 3.10.0
+        version: 3.11.0
   type: :runtime
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
     requirements:
     - - "~>"
       - !ruby/object:Gem::Version
-        version: 3.10.0
+        version: 3.11.0
 - !ruby/object:Gem::Dependency
   name: diff-lcs
   requirement: !ruby/object:Gem::Requirement
@@ -99,16 +99,16 @@
   name: cucumber
   requirement: !ruby/object:Gem::Requirement
     requirements:
-    - - "~>"
+    - - ">="
       - !ruby/object:Gem::Version
-        version: 1.3.15
+        version: '1.3'
   type: :development
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
     requirements:
-    - - "~>"
+    - - ">="
       - !ruby/object:Gem::Version
-        version: 1.3.15
+        version: '1.3'
 - !ruby/object:Gem::Dependency
   name: aruba
   requirement: !ruby/object:Gem::Requirement
@@ -194,7 +194,7 @@
 - MIT
 metadata:
   bug_tracker_uri: https://github.com/rspec/rspec-mocks/issues
-  changelog_uri: https://github.com/rspec/rspec-mocks/blob/v3.10.2/Changelog.md
+  changelog_uri: https://github.com/rspec/rspec-mocks/blob/v3.11.0/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
@@ -214,8 +214,8 @@
     - !ruby/object:Gem::Version
       version: '0'
 requirements: []
-rubygems_version: 3.2.4
+rubygems_version: 3.3.3
 signing_key:
 specification_version: 4
-summary: rspec-mocks-3.10.2
+summary: rspec-mocks-3.11.0
 test_files: []
Binary files old/metadata.gz.sig and new/metadata.gz.sig differ

Reply via email to