You’re mapping absolute strings (URL’s) to your routes. Any string
manipulation would dilute the spec. In my opinion, this is not a case of
keeping things DRY.
You’re mapping absolute strings (URL’s) to your routes. Any string
manipulation would dilute the spec. In my opinion, this is not a case of
keeping things DRY.
It’s clear that you have understood my intent: keep things DRY by
specifying the prefix once, and write tests as though the prefix is
implicitly specified.
But what do you mean by ‘dilute the spec’?
Do you think it might make the spec brittle?
Pat:
I just want to keep things DRY by specifying the ‘v1’ prefix once, so
the example would be ‘v1/…’, only ‘v1’ would be implicitly set in some
way.
On Wed, Mar 23, 2011 at 12:16 PM, Radhesh K. [email protected]
wrote:
You’re mapping absolute strings (URL’s) to your routes. Any string
manipulation would dilute the spec. In my opinion, this is not a case of
keeping things DRY.
It’s clear that you have understood my intent: keep things DRY by
specifying the prefix once, and write tests as though the prefix is
implicitly specified.
But what do you mean by ‘dilute the spec’?
It makes it hard to read. You have a new concept to understand: all
the routes being specified are not the routes being specified.
Do you think it might make the spec brittle?
Pat:
I just want to keep things DRY by specifying the ‘v1’ prefix once, so
the example would be ‘v1/…’, only ‘v1’ would be implicitly set in some
way.
What you propose would introduce an abstraction that will make it
harder to understand failures in order to save a few duplicate
keystrokes. This is not what DRY is about. See artima - Orthogonality and the DRY Principle for some background on that.
Cheers,
David
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.