Hello community,

here is the log from the commit of package rubygem-mocha for openSUSE:Factory 
checked in at 2016-11-07 12:23:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-mocha (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-mocha.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-mocha"

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-mocha/rubygem-mocha.changes      
2016-10-18 10:40:18.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.rubygem-mocha.new/rubygem-mocha.changes 
2016-11-07 12:23:03.000000000 +0100
@@ -1,0 +2,6 @@
+Sun Oct 16 04:34:16 UTC 2016 - co...@suse.com
+
+- updated to version 1.2.1
+  no changelog found
+
+-------------------------------------------------------------------

Old:
----
  mocha-1.2.0.gem

New:
----
  mocha-1.2.1.gem

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

Other differences:
------------------
++++++ rubygem-mocha.spec ++++++
--- /var/tmp/diff_new_pack.vpfMou/_old  2016-11-07 12:23:04.000000000 +0100
+++ /var/tmp/diff_new_pack.vpfMou/_new  2016-11-07 12:23:04.000000000 +0100
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-mocha
-Version:        1.2.0
+Version:        1.2.1
 Release:        0
 %define mod_name mocha
 %define mod_full_name %{mod_name}-%{version}

++++++ mocha-1.2.0.gem -> mocha-1.2.1.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md       2016-10-10 16:40:22.000000000 +0200
+++ new/README.md       2016-10-15 15:09:06.000000000 +0200
@@ -109,6 +109,7 @@
 
 #### Known Issues
 
+* In Mocha v1.2.0 there is a scenario where stubbing a class method originally 
defined in a module hangs the Ruby interpreter due to [a bug in Ruby 
v2.3.1](https://bugs.ruby-lang.org/issues/12832). See #272. This was fixed in 
Mocha v1.2.1.
 * Stubbing an aliased class method, where the original method is defined in a 
module that's used to `extend` the class doesn't work in Ruby 1.8.x. See 
stub_method_defined_on_module_and_aliased_test.rb for an example of this 
behaviour.
 * 0.13.x versions cause a harmless, but annoying, deprecation warning when 
used with Rails 3.2.0-3.2.12, 3.1.0-3.1.10 & 3.0.0-3.0.19.
 * 0.11.x versions don't work with Rails 3.2.13 (`TypeError: superclass 
mismatch for class ExpectationError`). See #115.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/RELEASE.md new/RELEASE.md
--- old/RELEASE.md      2016-10-10 16:40:22.000000000 +0200
+++ new/RELEASE.md      2016-10-15 15:09:06.000000000 +0200
@@ -1,5 +1,9 @@
 # Release Notes
 
+## 1.2.1
+
+* Fixed #272. Workaround Ruby bug 12832 which caused interpreter to hang. See 
https://bugs.ruby-lang.org/issues/12832. Thanks to @chrisroos & @petems 
(6f1c8b9b, #273).
+
 ## 1.2.0
 
 * Always use prepended module to stub class & instance methods for Ruby v2+ - 
thanks to @grosser & @chrisroos (43d56671, #244)
Files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/mocha/class_method.rb 
new/lib/mocha/class_method.rb
--- old/lib/mocha/class_method.rb       2016-10-10 16:40:22.000000000 +0200
+++ new/lib/mocha/class_method.rb       2016-10-15 15:09:06.000000000 +0200
@@ -40,11 +40,11 @@
     def hide_original_method
       if @original_visibility = method_visibility(method)
         begin
-          @original_method = stubbee._method(method)
           if RUBY_V2_PLUS
             @definition_target = PrependedModule.new
             stubbee.__metaclass__.__send__ :prepend, @definition_target
           else
+            @original_method = stubbee._method(method)
             if @original_method && @original_method.owner == 
stubbee.__metaclass__
               stubbee.__metaclass__.send(:remove_method, method)
             end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/mocha/version.rb new/lib/mocha/version.rb
--- old/lib/mocha/version.rb    2016-10-10 16:40:22.000000000 +0200
+++ new/lib/mocha/version.rb    2016-10-15 15:09:06.000000000 +0200
@@ -1,3 +1,3 @@
 module Mocha
-  VERSION = "1.2.0"
+  VERSION = "1.2.1"
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2016-10-10 16:40:22.000000000 +0200
+++ new/metadata        2016-10-15 15:09:06.000000000 +0200
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: mocha
 version: !ruby/object:Gem::Version
-  version: 1.2.0
+  version: 1.2.1
 platform: ruby
 authors:
 - James Mead
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2016-10-10 00:00:00.000000000 Z
+date: 2016-10-15 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: metaclass
@@ -236,6 +236,7 @@
 - test/acceptance/expectations_on_multiple_methods_test.rb
 - test/acceptance/expected_invocation_count_test.rb
 - test/acceptance/failure_messages_test.rb
+- test/acceptance/issue_272_test.rb
 - test/acceptance/issue_65_test.rb
 - test/acceptance/issue_70_test.rb
 - test/acceptance/mocha_example_test.rb
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/acceptance/issue_272_test.rb 
new/test/acceptance/issue_272_test.rb
--- old/test/acceptance/issue_272_test.rb       1970-01-01 01:00:00.000000000 
+0100
+++ new/test/acceptance/issue_272_test.rb       2016-10-15 15:09:06.000000000 
+0200
@@ -0,0 +1,52 @@
+require File.expand_path('../acceptance_test_helper', __FILE__)
+require 'mocha/setup'
+
+class Issue272Test < Mocha::TestCase
+
+  include AcceptanceTest
+
+  def setup
+    setup_acceptance_test
+  end
+
+  def teardown
+    teardown_acceptance_test
+  end
+
+  module Mod
+    private
+
+    def foo
+      'original-foo'
+    end
+
+    def bar
+      'original-bar'
+    end
+  end
+
+  class Klass
+    extend Mod
+
+    class << self
+      public :foo
+      public :bar
+    end
+  end
+
+  def test_private_methods_in_module_used_to_extend_class_and_made_public
+    test_result = run_as_test do
+      Klass.stubs(:foo).returns('stubbed-foo')
+      # hangs in next line executing:
+      # `@original_method = stubbee._method(method)`
+      # in Mocha::ClassMethod#hide_original_method
+      # but only in Ruby v2.3, not v2.2
+      Klass.stubs(:bar).returns('stubbed-bar')
+      assert_equal 'stubbed-foo', Klass.foo
+      assert_equal 'stubbed-bar', Klass.bar
+    end
+    assert_passed(test_result)
+    assert_equal 'original-foo', Klass.foo
+    assert_equal 'original-bar', Klass.bar
+  end
+end


Reply via email to