On May 25, 11:48 pm, Marnen Laibow-Koser <[email protected]> wrote:
> Ginty wrote:
> > On May 25, 10:51 pm, Marnen Laibow-Koser <[email protected]> wrote:
> >> > arguments....meh.
>
> >> Uh, no. Passing closures (blocks) as arguments is one feature that
> >> makes Ruby very powerful. You'll have to do better than "meh" to
> >> explain why you're choosing not to use a key Ruby feature, at least if
> >> you want people to take you seriously and use your software.
>
> > Haha, yeah you've probably taken me down a path here I didn't really
> > mean to go down.
>
> > Marnen says: I didn't lead you down ...
>
> > Yeah I know.
>
> > Bottom line, this to me is ugly:
>
> > u.email {|a| "#{a.first_name}.#{[email protected]" }
>
> > this is more elegant in it's simplicity:
>
> > :email => "#{first_name}.#{[email protected]"
>
> > Personal preference.
>
> For a trivial example like that, sure.  But it doesn't generalize to
> anything more complex.  Blocks do.
>
>
>
> >> >> is so I can just say Widget.make and get a fully viable Widget object,
> >> > and how you relate them.
>
> >> > def user
> >> > # Define attributes via a hash, generate the values any way you want
> >> > define :name => "Jimmy",
> >> > # An 'n' counter method is available to help make things
> >> > unique
>
> >> Does it work with Faker?
>
> > Yeah it'll work with anything like that, you're just defining a
> > regular method,
>
> I noticed that.  On what class?
>
> > require what you will.
>
> >> > :email => "jimmy#[email protected]",
> >> > :role => :user,
> >> > # Call your own helper methods to wire up your
> >> > associations...
>
> >> Does :user just get passed to a helper, or what?
>
> > Good point, maybe a bad example, :user was just the value I pass to my
> > user.role= method.
>
> Why on earth would you assign a symbol to what I assume is an
> association?

It's an attribute.

>
> > It doesn't refer to the user factory, model or
> > otherwise. Could equally have been :admin or what have you. I'll
> > change this in the docs.
>
> >> And what didn't you feel in control of with Machinist or Factory Girl?
> >> Machinist in particular just uses the usual Rails association
> >> mechanisms.
>
> > For me they are too heavy, too much magic at times (admittedly I am a
> > Factory Girl guy), I need to think too much about how to create an
> > association if I want anything other than a randomly generated one,
> > and ultimately I just don't like the syntax.
>
> I'm not all that fond of FG's association syntax either.  But for
> Machinist, it really is just
> Post.make.comments.make
> or
> Comment.make :post => Post.make
> just like Rails.  If you find that hard to understand, I don't know what
> more I can say.
>
> > The combination of these
> > things has made me feel that I've never really 'flowed' with this
> > aspect of writing my tests for want of a better description.
>
> Then try Machinist!
>
> > I said in the blog that Miniskirt was a real revelation to me as it
> > showed me that these factory helpers don't need to do much, I don't
> > quite understand now why some of them are so big under the hood, but
> > Miniskirt didn't hit the syntax aspect for me either.
>
> I've never even heard of it.
>
>
>
> > So Cranky is now my factory of choice, it feels good, very good, and I
> > don't think that I have abnormal tastes. So I've packaged it up should
> > others like it to. So if you do cool, if you don't that's cool to,
> > we're not exactly short of choice here.
>
> I think that in your quest for "simplicity", you've wound up with
> something that seems to take twice as much work as Machinist to set up a
> usable test environment.
>

Yep I think we're done here, I don't deny that Machinist may be good,
but I think this is good to.

If this has aroused anyone's interest please have a look at the README
and judge for yourself.

It couldn't be simpler to set up test environment.


> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> [email protected]
> --
> Posted viahttp://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.

Reply via email to