[rspec-users] Cucumber - stub! or mock?
aslak.hellesoy at gmail.com
Mon Sep 15 17:13:16 EDT 2008
On Mon, Sep 15, 2008 at 11:01 PM, Joseph Wilk <lists at ruby-forum.com> wrote:
> Tim Glen wrote:
>> 1. Is there a way to stub out the model to return some fixture-type
>> 2. Does anyone have an idea as to how we could refactor this into a
>> better pattern? Those 2 "projects" are pretty specific to the
>> production data and will "never be edited," but it still doesn't make
>> me comfortable.
>> I'm not sure how to phrase this better. Let me know what other detail
>> I can provide to make it more clear what I'm looking for.
> As Pat said I would avoid mocking/stubbing, you want your cucumber tests
> to cut through all the layers of your app including touching the
I second that.
> As for setting up the data, I tend not to use fixtures (I only want to
> have the data created for certain tests). Instead I save the relevant
> models in the Given steps, preparing for the feature test. If you are
> going to repeat the given steps a lot I would extract the model set-up
> into a ruby function and reuse this.
> Joseph Wilk
> Posted via http://www.ruby-forum.com/.
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users