Brandon Olivares wrote:
So is this necessarily bad? I've heard it's not always good to reduce
duplication in tests, but it just seems much preferable than copy/paste.
Refactor production code (while passing the tests after each edit) to make it as
DRY as possible. This _typically_ means dupli
@rubyforge.org] On Behalf Of David Chelimsky
> >> Sent: Friday, April 10, 2009 3:10 AM
> >> To: rspec-users
> >> Subject: Re: [rspec-users] Eliminating duplication from tests
> >>
> >> Can you please post specific examples of the use of these so we
&g
Brandon Olivares wrote:
Oh, and that described_class trick is great; thanks for showing me that.
http://c2.com/cgi/wiki?AbstractTest ?
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Of David Chelimsky
> >> Sent: Friday, April 10, 2009 3:10 AM
> >> To: rspec-users
> >> Subject: Re: [rspec-users] Eliminating duplication from tests
> >>
> >> Can you please post specific examples of the use of these so we
> don't
> >> hav
c-users
>> Subject: Re: [rspec-users] Eliminating duplication from tests
>>
>> Can you please post specific examples of the use of these so we don't
>> have to talk in generalities?
>
> Sure, here is something I just wrote.
>
> def assert_route
> -Original Message-
> From: rspec-users-boun...@rubyforge.org [mailto:rspec-users-
> boun...@rubyforge.org] On Behalf Of David Chelimsky
> Sent: Friday, April 10, 2009 3:10 AM
> To: rspec-users
> Subject: Re: [rspec-users] Eliminating duplication from tests
>
On Fri, Apr 10, 2009 at 1:14 AM, Brandon Olivares
wrote:
> Hi,
>
> Lately I've found myself trying to reduce typing as much as possible, so
> when I have a lot of tests that only differ in a few variables, I tend to
> abstract them to reduce typing.
abstract or extract? I think you mean extract.
Hi,
Lately I've found myself trying to reduce typing as much as possible, so
when I have a lot of tests that only differ in a few variables, I tend to
abstract them to reduce typing.
For instance, I have an assert_form_errors method that I call within a
describe block to ensure the proper errors