I'm using rspec and cucumber for BBD. Now I'm migrating to rails 3 and rspec 2 and as I could see both of frameworks (shoulda and remarkable) support rails 3 and rspec 2.
I have never used shoulda or remarkable.
What should I prefer to use with rspec: shoulda or remarkable? And why?
I don't see Shoulda and RSpec in an either-or-relation. I use Shoulda as a substitute for RSpec when it comes to single-assertion testing. I really like the Shoulda one-liners, but writing matchers is much easier in RSpec.
Here you can choose between Test::Unit, RSpec, Shoulda and so on. The choice is whether you want to do traditional TDD (Test::Unit) or whether you prefer the alternative ways of thinking about specifiying behaviour advocated by developers like David Chemlinsky(RSpec and to some extent Shoulda).
Shoulda Matchers is a Ruby testing gem, that provides RSpec- and Minitest-compatible one-liners that test common Rails functionality. These tests would otherwise be much longer, more complex, and error-prone. COACH: Talk about testing and Behavior-Driven Development. 1. Add Shoulda Matchers gem
Shoulda Matchers is a great tool to use to create one line tests for common functionality in Rails apps. I use them to test associations and validations within my Rails apps. We can use Shoulda Matchers to write this: These one liners are less error prone and easier to write. So onto the setup!
I think i would go for remarkable, since it is created especially for Rspec. Also it is extremely complete. Whereas Shoulda was created to get the rspec-style matchers inside Test::Unit.
Just my quick 2 cents.
[UPDATE] almost two years later, I am sorry to notice that remarkable is in a dreadful state. For rails 3.x you still have to use beta gems. I hope this will change or improve soon (unlikely), but for the moment I can only advise to use Shoulda.
Just an update, since the Rails world moves so fast: Shoulda seems to have garnered three times as many watchers, two times as many forks, and one and half as many contributors. Remarkable's last commit was over a year ago, and shoulda's was within this month. That said the last 5 contributions were basically small bugs or minor touch ups.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With