Hello community,

here is the log from the commit of package rubygem-rspec-mocks for 
openSUSE:Factory checked in at 2019-12-28 13:40:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-rspec-mocks (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-rspec-mocks.new.6675 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-rspec-mocks"

Sat Dec 28 13:40:01 2019 rev:19 rq:747740 version:3.9.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-rspec-mocks/rubygem-rspec-mocks.changes  
2019-07-22 12:16:26.431727304 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-rspec-mocks.new.6675/rubygem-rspec-mocks.changes
        2019-12-28 13:40:09.698922169 +0100
@@ -1,0 +2,15 @@
+Tue Nov 12 14:47:37 UTC 2019 - Manuel Schnitzer <[email protected]>
+
+- updated to version 3.9.0
+
+  [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.8.2...v3.9.0)
+
+  Enhancements:
+
+  * Improve thread safety of message expectations by using Mutex to prevent
+    deadlocking errors. (Ry Biesemeyer, #1236)
+  * Add the ability to use `time` as an alias for `times`. For example:
+    `expect(Class).to receive(:method).exactly(1).time`.
+    (Pistos, Benoit Tigeot, #1271)
+
+-------------------------------------------------------------------

Old:
----
  rspec-mocks-3.8.1.gem

New:
----
  rspec-mocks-3.9.0.gem

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

Other differences:
------------------
++++++ rubygem-rspec-mocks.spec ++++++
--- /var/tmp/diff_new_pack.ZDsTkK/_old  2019-12-28 13:40:10.594922620 +0100
+++ /var/tmp/diff_new_pack.ZDsTkK/_new  2019-12-28 13:40:10.594922620 +0100
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-rspec-mocks
-Version:        3.8.1
+Version:        3.9.0
 Release:        0
 %define mod_name rspec-mocks
 %define mod_full_name %{mod_name}-%{version}

++++++ rspec-mocks-3.8.1.gem -> rspec-mocks-3.9.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Changelog.md new/Changelog.md
--- old/Changelog.md    2019-06-13 10:35:48.000000000 +0200
+++ new/Changelog.md    2019-10-07 23:42:39.000000000 +0200
@@ -1,3 +1,20 @@
+### 3.9.0 / 2019-10-07
+[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.8.2...v3.9.0)
+
+Enhancements:
+
+* Improve thread safety of message expectations by using Mutex to prevent
+  deadlocking errors. (Ry Biesemeyer, #1236)
+* Add the ability to use `time` as an alias for `times`. For example:
+  `expect(Class).to receive(:method).exactly(1).time`.
+  (Pistos, Benoit Tigeot, #1271)
+
+### 3.8.2 / 2019-10-02
+[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.8.1...v3.8.2)
+
+* Allow `array_including` argument matchers to be nested.
+  (Emmanuel Delmas, #1291)
+
 ### 3.8.1 / 2019-06-13
 [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.8.0...v3.8.1)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md       2019-06-13 10:35:48.000000000 +0200
+++ new/README.md       2019-10-07 23:42:39.000000000 +0200
@@ -285,12 +285,15 @@
 ```ruby
 expect(double).to receive(:msg).once
 expect(double).to receive(:msg).twice
+expect(double).to receive(:msg).exactly(n).time
 expect(double).to receive(:msg).exactly(n).times
 expect(double).to receive(:msg).at_least(:once)
 expect(double).to receive(:msg).at_least(:twice)
+expect(double).to receive(:msg).at_least(n).time
 expect(double).to receive(:msg).at_least(n).times
 expect(double).to receive(:msg).at_most(:once)
 expect(double).to receive(:msg).at_most(:twice)
+expect(double).to receive(:msg).at_most(n).time
 expect(double).to receive(:msg).at_most(n).times
 ```
 
@@ -327,7 +330,7 @@
 expect(double).to receive(:msg).exactly(3).times.and_return(value1, value2, 
value3)
   # returns value1 the first time, value2 the second, etc
 expect(double).to receive(:msg).and_raise(error)
-  # error can be an instantiated object or a class
+  # `error` can be an instantiated object (e.g. `StandardError.new(some_arg)`) 
or a class (e.g. `StandardError`)
   # if it is a class, it must be instantiable with no args
 expect(double).to receive(:msg).and_throw(:msg)
 expect(double).to receive(:msg).and_yield(values, to, yield)
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/chain.rb 
new/lib/rspec/mocks/any_instance/chain.rb
--- old/lib/rspec/mocks/any_instance/chain.rb   2019-06-13 10:35:48.000000000 
+0200
+++ new/lib/rspec/mocks/any_instance/chain.rb   2019-10-07 23:42:39.000000000 
+0200
@@ -41,6 +41,7 @@
           record :thrice
           record :exactly
           record :times
+          record :time
           record :never
           record :at_least
           record :at_most
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/rspec/mocks/argument_matchers.rb 
new/lib/rspec/mocks/argument_matchers.rb
--- old/lib/rspec/mocks/argument_matchers.rb    2019-06-13 10:35:48.000000000 
+0200
+++ new/lib/rspec/mocks/argument_matchers.rb    2019-10-07 23:42:39.000000000 
+0200
@@ -241,6 +241,8 @@
               RSpec::Support::FuzzyMatcher.values_match?(expected_element, 
actual_element)
             end
           end
+        rescue NoMethodError
+          false
         end
 
         def description
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       2019-06-13 
10:35:48.000000000 +0200
+++ new/lib/rspec/mocks/matchers/have_received.rb       2019-10-07 
23:42:39.000000000 +0200
@@ -5,7 +5,7 @@
       class HaveReceived
         include Matcher
 
-        COUNT_CONSTRAINTS = %w[exactly at_least at_most times once twice 
thrice]
+        COUNT_CONSTRAINTS = %w[exactly at_least at_most times time once twice 
thrice]
         ARGS_CONSTRAINTS = %w[with]
         CONSTRAINTS = COUNT_CONSTRAINTS + ARGS_CONSTRAINTS + %w[ordered]
 
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  2019-06-13 10:35:48.000000000 
+0200
+++ new/lib/rspec/mocks/message_expectation.rb  2019-10-07 23:42:39.000000000 
+0200
@@ -1,3 +1,5 @@
+RSpec::Support.require_rspec_support 'mutex'
+
 module RSpec
   module Mocks
     # A message expectation that only allows concrete return values to be set
@@ -236,6 +238,7 @@
         self.inner_implementation_action = block
         self
       end
+      alias time times
 
       # Expect a message not to be received at all.
       #
@@ -357,6 +360,7 @@
       # some collaborators it delegates to for this stuff but for now this was
       # the simplest way to split the public from private stuff to make it
       # easier to publish the docs for the APIs we want published.
+      # rubocop:disable Metrics/ModuleLength
       module ImplementationDetails
         attr_accessor :error_generator, :implementation
         attr_reader :message
@@ -378,6 +382,7 @@
           @orig_object = @method_double.object
           @message = @method_double.method_name
           @actual_received_count = 0
+          @actual_received_count_write_mutex = Support::Mutex.new
           @expected_received_count = type == :expectation ? 1 : :any
           @argument_list_matcher = ArgumentListMatcher::MATCH_ALL
           @order_group = expectation_ordering
@@ -536,7 +541,9 @@
         end
 
         def increase_actual_received_count!
-          @actual_received_count += 1
+          @actual_received_count_write_mutex.synchronize do
+            @actual_received_count += 1
+          end
         end
 
       private
@@ -567,7 +574,9 @@
             parent_stub.invoke(nil, *args, &block)
           end
         ensure
-          @actual_received_count += increment
+          @actual_received_count_write_mutex.synchronize do
+            @actual_received_count += increment
+          end
         end
 
         def has_been_invoked?
@@ -626,6 +635,7 @@
           nil
         end
       end
+      # rubocop:enable Metrics/ModuleLength
 
       include ImplementationDetails
     end
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        2019-06-13 10:35:48.000000000 +0200
+++ new/lib/rspec/mocks/proxy.rb        2019-10-07 23:42:39.000000000 +0200
@@ -9,6 +9,11 @@
         end
       end
 
+      unless defined?(Mutex)
+        Support.require_rspec_support 'mutex'
+        Mutex = Support::Mutex
+      end
+
       # @private
       def ensure_implemented(*_args)
         # noop for basic proxies, see VerifyingProxy for behaviour.
@@ -20,6 +25,7 @@
         @order_group = order_group
         @error_generator = ErrorGenerator.new(object)
         @messages_received = []
+        @messages_received_mutex = Mutex.new
         @options = options
         @null_object = false
         @method_doubles = Hash.new { |h, k| h[k] = MethodDouble.new(@object, 
k, self) }
@@ -90,27 +96,31 @@
           
@error_generator.raise_expectation_on_unstubbed_method(expected_method_name)
         end
 
-        @messages_received.each do |(actual_method_name, args, received_block)|
-          next unless expectation.matches?(actual_method_name, *args)
+        @messages_received_mutex.synchronize do
+          @messages_received.each do |(actual_method_name, args, 
received_block)|
+            next unless expectation.matches?(actual_method_name, *args)
 
-          expectation.safe_invoke(nil)
-          block.call(*args, &received_block) if block
+            expectation.safe_invoke(nil)
+            block.call(*args, &received_block) if block
+          end
         end
       end
 
       # @private
       def check_for_unexpected_arguments(expectation)
-        return if @messages_received.empty?
+        @messages_received_mutex.synchronize do
+          return if @messages_received.empty?
 
-        return if @messages_received.any? { |method_name, args, _| 
expectation.matches?(method_name, *args) }
+          return if @messages_received.any? { |method_name, args, _| 
expectation.matches?(method_name, *args) }
 
-        name_but_not_args, others = @messages_received.partition do 
|(method_name, args, _)|
-          expectation.matches_name_but_not_args(method_name, *args)
-        end
+          name_but_not_args, others = @messages_received.partition do 
|(method_name, args, _)|
+            expectation.matches_name_but_not_args(method_name, *args)
+          end
 
-        return if name_but_not_args.empty? && !others.empty?
+          return if name_but_not_args.empty? && !others.empty?
 
-        expectation.raise_unexpected_message_args_error(name_but_not_args.map 
{ |args| args[1] })
+          
expectation.raise_unexpected_message_args_error(name_but_not_args.map { |args| 
args[1] })
+        end
       end
 
       # @private
@@ -141,17 +151,23 @@
 
       # @private
       def reset
-        @messages_received.clear
+        @messages_received_mutex.synchronize do
+          @messages_received.clear
+        end
       end
 
       # @private
       def received_message?(method_name, *args, &block)
-        @messages_received.any? { |array| array == [method_name, args, block] }
+        @messages_received_mutex.synchronize do
+          @messages_received.any? { |array| array == [method_name, args, 
block] }
+        end
       end
 
       # @private
       def messages_arg_list
-        @messages_received.map { |_, args, _| args }
+        @messages_received_mutex.synchronize do
+          @messages_received.map { |_, args, _| args }
+        end
       end
 
       # @private
@@ -162,7 +178,9 @@
       # @private
       def record_message_received(message, *args, &block)
         @order_group.invoked SpecificMessage.new(object, message, args)
-        @messages_received << [message, args, block]
+        @messages_received_mutex.synchronize do
+          @messages_received << [message, args, block]
+        end
       end
 
       # @private
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      2019-06-13 10:35:48.000000000 +0200
+++ new/lib/rspec/mocks/version.rb      2019-10-07 23:42:39.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.8.1'
+      STRING = '3.9.0'
     end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2019-06-13 10:35:48.000000000 +0200
+++ new/metadata        2019-10-07 23:42:39.000000000 +0200
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: rspec-mocks
 version: !ruby/object:Gem::Version
-  version: 3.8.1
+  version: 3.9.0
 platform: ruby
 authors:
 - Steven Baker
@@ -45,7 +45,7 @@
   ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
   F3MdtaDehhjC
   -----END CERTIFICATE-----
-date: 2019-06-13 00:00:00.000000000 Z
+date: 2019-10-07 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: rspec-support
@@ -53,14 +53,14 @@
     requirements:
     - - "~>"
       - !ruby/object:Gem::Version
-        version: 3.8.0
+        version: 3.9.0
   type: :runtime
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
     requirements:
     - - "~>"
       - !ruby/object:Gem::Version
-        version: 3.8.0
+        version: 3.9.0
 - !ruby/object:Gem::Dependency
   name: diff-lcs
   requirement: !ruby/object:Gem::Requirement
@@ -115,14 +115,14 @@
     requirements:
     - - "~>"
       - !ruby/object:Gem::Version
-        version: 0.6.2
+        version: 0.14.10
   type: :development
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
     requirements:
     - - "~>"
       - !ruby/object:Gem::Version
-        version: 0.6.2
+        version: 0.14.10
 - !ruby/object:Gem::Dependency
   name: minitest
   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.8.1/Changelog.md
+  changelog_uri: https://github.com/rspec/rspec-mocks/blob/v3.9.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.0.3
+rubygems_version: 3.0.6
 signing_key: 
 specification_version: 4
-summary: rspec-mocks-3.8.1
+summary: rspec-mocks-3.9.0
 test_files: []
Binary files old/metadata.gz.sig and new/metadata.gz.sig differ


Reply via email to