[rspec-users] Custom Matchers : Shouldn't they follow DRY principle ?
amir.nagri at gmail.com
Wed Jun 9 23:31:39 EDT 2010
I am trying to write custom matchers for RESTful behavior of my controllers.
I have created two matchers
In be_created, I check for the status code to be 201 and a location of the
new resource. In have_created_resource, i also pass in the resource that was
created and verify it exists (non nil check) as well as that it passes the
Github commit =>
I am getting an error saying be_created not found. Obviously, be_created is
not in scope but if I fix it and include the required module it fails for
be_nil not found.
I am finding this way of reusing the matchers not correct.
Is there a standard way of re-using matchers inside matchers ? Have anybody
tried it out ?
Bangalore, 560008, KA
Y! IM : amir_nagri at yahoo.com
GTalk : amir.nagri at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users