[MacRuby-devel] Issue with running unit tests when requiring rubygems

Ryan Davis ryand-ruby at zenspider.com
Mon Feb 14 15:23:29 PST 2011


On Feb 13, 2011, at 05:56 , Gabriel Ayuso wrote:

> I reinstalled the minitest and mocha gems to the following versions: minitest-2.0.2, mocha-0.9.12
> The same issue I described before occurred once again.
> 
> Here's the code I ran on macirb and the result: 
> 
> require 'rubygems' 	#=> true
> gem 'minitest'		#=> true
> require 'test/unit'		#=> true
> require 'mocha'		#=> true
> class QuickTest < Test::Unit::TestCase
>    def test_quick
>      obj = mock('obj')
>      obj.expects(:a).returns(true)
>      assert( obj.a )
>    end
>  end 				# => nil
> exit

I can confirm this with the following minimal repro:

require "rubygems"
require "isolate"

Isolate.now! :system => false do
  gem "minitest"
  gem "mocha"
end

gem "minitest"
require "minitest/autorun"
require "mocha"

class QuickTest < MiniTest::Unit::TestCase
  def test_quick
    obj = mock("obj")
  end
end

The test only fails on macruby and with mocha. I'll file a ticket.



More information about the MacRuby-devel mailing list