thoughtbot / paperclip

Easy file attachment management for ActiveRecord
https://thoughtbot.com
Other
9.01k stars 2.43k forks source link

Tests fail using jferris-mocha. Using Gemcutter's mocha gem works. #120

Closed Hates closed 14 years ago

Hates commented 14 years ago

I forked the project and installed the jerris-mocha gem to resolve the dependency issue, but received a load of errors. Switching the dependency over to Gemcutter's mocha gem worked. I have created a branch with my change in.

http://github.com/Hates/paperclip/commits/mocha-patch

Such a small change, doesn't seem worth it. Hopefully I haven't missed anything out.

Hates commented 14 years ago

Ok, my bad. Seems my errors were related to something else :( but it's all working fine now :D

jdrowell commented 14 years ago

Fixed most broken tests for me, still got 2 ("assert_received" is missing), will look into them. This is using activesupport 2.3.5 (which also includes mocha, >= 0.9.7). activesupport-2.3.5/lib/active_support/test_case.rb

jyurek commented 14 years ago

jdrowell, what versions of mocha do you have installed, including jferris-mocha?

jdrowell commented 14 years ago

jyurek, I'm using the latest mocha (0.9.8). I tried 2 versions of jferris-mocha (the latest one and the one required by the paperclip gem) and neither passed a huge number of tests. I still get the 2 non-passing tests I described above but I don't touch that part of the code so for me having the other 600+ passing tests is enough ;)

BTW I sent a pull request for another Issue I fixed and it includes the on-liner change to the mocha gem require. My fork is here:

http://github.com/jdrowell/paperclip/tree/master

BTW2 I was using paperclip 2.3.1 (GitHub gem) and am now using jdrowell-paperclip 2.3.1.1 from GemCutter.

jyurek commented 14 years ago

I'm not sure what's going on there. I have the following installed:

0 Spacesuit:~/Development/paperclip jyurek (master)$ gem list | grep mocha
jferris-mocha (0.9.7.20090911190113, 0.9.5.0.1241126838)
mocha (0.9.8, 0.9.7)
0 Spacesuit:~/Development/paperclip jyurek (master)$

and I get no failures when raking master right now. Can you make sure you have the latest code and try again? Are the failures mocha-related? What is the error message of, presumably, most of them?

jdrowell commented 14 years ago

Just made a clean checkout of master and reinstalled jferris-mocha forcing the version in the gemspec and I also get a clean rake test now :)

jferris-mocha (0.9.5.0.1241126838) mocha (0.9.8)

cainlevy commented 14 years ago

I fixed this for myself by updating mocha from 0.9.5 to 0.9.8. It appears that jferris-mocha is only required for two tests that use its assert_received method.

jyurek commented 14 years ago

So after some finagling and trying to figure load orders and whatnot, I've simply removed the jferris-mocha requirement, and only mocha is required now. This change is on master.