State of Remarkable/Rails

7 views
Skip to first unread message

Ho-Sheng Hsiao

unread,
Jun 14, 2010, 4:13:22 PM6/14/10
to Remarkable
Hi guys,

Since working on the port for Remarkable matchers, I was surprised as
the amount of interest in remarkable/rails. I've never used it just as
I've never used all the other solutions out there -- including
cucumber. They did not work the way I want it to. I also find it
ridiculous to mock models, sessions, and accounts just so you can test
assignments especially since I find view tests as very brittle.

I wanted to share with you a snippet of rspec 2 code that I have been
working on for a web service:

https://gist.github.com/741657dae42ae9706672

This was implemented in pure Rspec 2 beta11. I did not use Remarkable
at all. I used let(), which was implemented in Rspec 1.29, which is
effectively a Lisp-style "let". I also took advantage of the metadata
framework in Rspec 2 that got imported from Micronaut.

This set of tests actually sends Rack requests directly to the entire
application stack and runs the tests based on the standard Rack
response you get back. As such, it actually evolved from a set of
Resources spec helpers that were in turn built on top of Rack spec
helpers.

And like all things Rspec, there isn't much in the way of i18n
support.

I'm sharing this with people on this list to show there is an
alternative. I may get these helpers open-sourced, but they don't
really run under Remarkable framework at all, and they assume you are
using Machinist instead of mocking.

I've considered re-architecting Remarkable::Core so it is more Rspec
and less its ancestor, Shoulda. (At the very least for my sanity,
aliasing assertions to expectations). That is, it would basically be a
convenience framework to help you work with metadata, let() and add
i18n for it.

I'd love to hear your thoughts about this.

Ho-Sheng Hsiao
Reply all
Reply to author
Forward
0 new messages