rspec-rails-mocha

3 views
Skip to first unread message

floehopper

unread,
Dec 2, 2008, 3:47:03 PM12/2/08
to mocha-developer
I thought I'd draw people's attention to this blog post [1] and the
corresponding code on GitHub [2].

I'm wondering whether there is place for some of this code (e.g.
mock_model) in Mocha. I registered mocha-rails [3] on RubyForge some
time ago with the idea that anything Rails-specific would go in there.
At the moment, the only Rails-specific code in Mocha proper is init.rb
(to make it work as a Rails plugin) and I've resisted adding anything
else.

How would people feel if I were to start putting Rails-specific code
in mocha-rails? Something that I've always wanted is to have some
acceptance tests that checked Mocha continued to work with different
versions of Rails.

Anyway, just some thoughts.

Cheers, James.
http://blog.floehopper.org

[1] http://jakescruggs.blogspot.com/2008/11/if-you-use-mocha-and-rspec-then-read.html
[2] http://github.com/mislav/rspec-rails-mocha/tree/master
[3] http://rubyforge.org/projects/mocha-rails/

Ken Collins

unread,
Dec 2, 2008, 3:58:07 PM12/2/08
to mocha-d...@googlegroups.com

I'm usually resistant to change for change sake but I really like the
idea of mock_model or something like mock_armodel. I never knew that
RSpec had something like that, I use Shoulda myself. But I would
really really like to see this in future versions of Mocha.

Also, perhaps the work in the Shoulda gem on Github might give you an
idea on how you can incorporate this into Mocha and just use a require
or config.gem lib like 'mocha/rails', which is something Shoulda does
since you do not have to use Shoulda with rails but if you do you get
their ActiveRecord macros, etc.


- Ken

James Mead

unread,
Jan 4, 2009, 1:22:00 PM1/4/09
to mocha-d...@googlegroups.com
2008/12/2 Ken Collins <k...@metaskills.net>
I'm usually resistant to change for change sake but I really like the
idea of mock_model or something like mock_armodel. I never knew that
RSpec had something like that, I use Shoulda myself. But I would
really really like to see this in future versions of Mocha.

Also, perhaps the work in the Shoulda gem on Github might give you an
idea on how you can incorporate this into Mocha and just use a require
or config.gem lib like 'mocha/rails', which is something Shoulda does
since you do not have to use Shoulda with rails but if you do you get
their ActiveRecord macros, etc.

Thanks, Ken - that's really helpful.

As I mentioned in a previous message, I've added a Lighthouse ticket to track this issue [1].

--
James.
http://blog.floehopper.org

[1] http://floehopper.lighthouseapp.com/projects/22289/tickets/22
Reply all
Reply to author
Forward
0 new messages