[mocha-developer] advice on new failures with 0.5.0

Justin Perkins justin at spiceworks.com
Tue Jun 12 16:02:55 EDT 2007


> Can you try to distil one of your failing tests down to make it as  
> simple
> and self-contained as you can, but still exhibiting the error? We  
> need to
> reproduce the bug before we can fix it.

In trying to make a small, reproducible test case (that passed every  
time) I discovered an error (surprise) in our code that wasn't  
discovered by the previous version of Mocha. This new exception led  
me to wrongly accuse Mocha. All is well and we are happily using  
0.5.0 now.

> Also can you tell us how you are including Mocha in your project?  
> e.g. Rails
> plugin, Ruby gem, etc.

It's a Rails project, using the Mocha gem.

> Sorry about the missing release notes - I'll try and get that  
> sorted asap -
> in the meantime this blog post pretty much covers it -
> http://blog.floehopper.org/articles/2007/06/08/mocha-0-5-released.

Thanks for that, hadn't seen that yet.

-justin

On Jun 12, 2007, at 1:32 PM, James Mead wrote:

> Hi Justin,
>
> I just tried to reproduce your error...
>
> require 'test/unit'
> require 'rubygems'
> require 'mocha'
>
> class MyTest < Test::Unit::TestCase
>
>   class DataMonitor
>     def toggle_notification!
>     end
>   end
>
>   def test_me
>     DataMonitor.any_instance.stubs(:toggle_notification!)
>     DataMonitor.new.toggle_notification!
>   end
>
> end
>
> This seems to work fine for me.
>
> Can you try to distil one of your failing tests down to make it as  
> simple
> and self-contained as you can, but still exhibiting the error? We  
> need to
> reproduce the bug before we can fix it.
>
> Also can you tell us how you are including Mocha in your project?  
> e.g. Rails
> plugin, Ruby gem, etc.
>
> Sorry about the missing release notes - I'll try and get that  
> sorted asap -
> in the meantime this blog post pretty much covers it -
> http://blog.floehopper.org/articles/2007/06/08/mocha-0-5-released.
> -- 
> James.
> http://blog.floehopper.org
> _______________________________________________
> mocha-developer mailing list
> mocha-developer at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mocha-developer



More information about the mocha-developer mailing list