Avatar Edgar González

  • Random
  • Archive
  • RSS

RSpec with Mongoid

If you are using Mongoid as ORM and RSpec for testing maybe you are interested in use the mongoid-rspec gem.

mongoid-rspec provide several RSpec matchers and macros for Mongoid.

If you are using the new master branch of Mongoid (which is my case), probably you are facing this error when try to run your specs (rake spec):

no such file to load -- mongoid/associations (LoadError)

This is because the new master branch of Mongoid has deleted the file mongoid/associations. You need use the safe_master branch. Or you can try to use this fork of Mongoid-rspec compatible with Mongoid 2.0.0.rc1:

https://github.com/shingara/mongoid-rspec/tree/mongoid-2.0.0.rc1

To do this, just add this gem to your gemfile:

gem 'mongoid-rspec', :git => 'git://github.com/shingara/mongoid-rspec.git', 
                     :branch => 'mongoid-2.0.0.rc1'
    • #rails3
    • #rails
    • #rspec
    • #MongoDB
    • #mongo
    • #mongoid
    • #test
    • #bdd
    • #nosql
    • #gemfile
  • 1 year ago
  • 2
  • Comments
  • Permalink
  • Share
    Tweet

2 Notes/ Hide

  1. edgar posted this

Recent comments

Blog comments powered by Disqus
← Previous • Next →

Portrait/Logo

About

When I'm not spending time with Jessica and my kids, I build web applications. Rails developer, believer of Agile Development and Lean startups. NoSQL enthusiast.
CTO and Lord of the API at Piictu

Me, Elsewhere

  • @edgar on Twitter
  • Facebook Profile
  • edgargonzaleznetve on Youtube
  • egg on Flickr
  • edgar on Foursquare
  • My Skype Info
  • Linkedin Profile
  • edgar on github

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr