Hassan Schroeder wrote: > On Tue, Dec 29, 2009 at 5:06 PM, Marnen Laibow-Koser > <[email protected]> wrote: > >>> Perhaps what's been lost here is the original question -- how do you >>> use test-data generators like Machinist/Sham when you need an >>> example of *invalid* data, that is, values not in the generated set? >>> It's simple with fixtures, eh, but... >> >> Only because you're putting the checking in the wrong place. �And >> anyway, that's a red herring: i explained how to do something exactly >> equivalent with Machinist (though I think it's a bad idea). > > Sorry, you've completely missed the point. > > The "use case" example I provided is utterly irrelevant. The data I > want to test against could be a string, an IP address, anything. > > I'm asking a generic question about using generators,
No, I think you're the one who's missed the point. I gave you an easily genericized way of generating invalid factory data -- figure out the range of valid data, then generate something out-of-band. Simple. I should say, though, that I rarely need to do this. > so if there > isn't an answer to my re-phrased question above, that's fine, and > I'll continue using fixtures. (The Machinist list hasn't seemed to be > able to come up with anything useful either.) Of course there's an answer. What part of my solution wasn't suitable? > > -- > Hassan Schroeder ------------------------ [email protected] > twitter: @hassan > > -- > > You received this message because you are subscribed to the Google > Groups "Ruby on Rails: Talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

