[macruby-changes] [1118] MacRuby/branches/experimental/mspec/lib/mspec/mocks/mock.rb

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 23 20:13:21 PDT 2009


Revision: 1118
          http://trac.macosforge.org/projects/ruby/changeset/1118
Author:   lsansonetti at apple.com
Date:     2009-03-23 20:13:21 -0700 (Mon, 23 Mar 2009)
Log Message:
-----------
work around the 'return from block' bug for now

Modified Paths:
--------------
    MacRuby/branches/experimental/mspec/lib/mspec/mocks/mock.rb

Modified: MacRuby/branches/experimental/mspec/lib/mspec/mocks/mock.rb
===================================================================
--- MacRuby/branches/experimental/mspec/lib/mspec/mocks/mock.rb	2009-03-24 00:10:48 UTC (rev 1117)
+++ MacRuby/branches/experimental/mspec/lib/mspec/mocks/mock.rb	2009-03-24 03:13:21 UTC (rev 1118)
@@ -94,6 +94,7 @@
 
     key = replaced_key obj, sym
     proxies = mocks[key] + stubs[key]
+    res_ok = false; res = nil # MR hack
     proxies.each do |proxy|
       pass = case proxy.arguments
       when :any_args
@@ -126,10 +127,13 @@
 
       if pass
         proxy.called
-        return proxy.returning
+        #return proxy.returning
+        res_ok = true; res = proxy.returning # MR hack
       end
     end
 
+    return res if res_ok # MR hack
+
     if sym.to_sym == :respond_to?
       return obj.__send__(replaced_name(obj, sym), compare)
     else
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090323/f84ee9d5/attachment.html>


More information about the macruby-changes mailing list