On 10/23/07, James Cox <[EMAIL PROTECTED]> wrote:
>  John,
>
> I still think the syntax is a little wet... When you're just specifying
> lists of things (like, apples, oranges and grapes):
>
> apple:
>   name: apple
>
> orange:
>   name: orange
>
> grape:
>   name: grape
>
> It'd be cool if you could collapse all that:
>
> fruits: grape, orange, apple
>

erm, IMO this is a case for some programattic record creation in your
actual test helper.

  %w( apple orange banana ).each { |fruit| Fruit.create(:name => fruit) }


my fixtures tend to be named after their function, so

invalid_name:
  name: Joe'"; DROP TABLE users
  id: 4
  address: 1 Main St, ..
  email: [EMAIL PROTECTED]

missing_email:
  name: Joe
  id: 5

etc.


Courtenay

> (this being fruits.yml)
>
> alternatively - in DEFAULTS, you could have keys that have a 'collapse'
> value.... and that collapses to the block key....
>
> OK, that probably makes no sense at all, but if it does, it'd be awesome if
> it had that support...
>
>  - james
>
>
>
>
> On 23 Oct 2007, at 06:49, John Barnette wrote:
>
>
> On 10/22/07, Courtenay <[EMAIL PROTECTED]> wrote:
> The syntax is great!  But this defaults thing is difficult to remember
>
> DEFAULTS: &DEFAULTS
>     created_on: <%= 3.weeks.ago.to_s(:db) %>
>
>   first:
>     name: Smurf
>     <<: *DEFAULTS
>
> Absolutely, and it would be really easy to support a DEFAULTS key
> internally instead of letting YAML do it. I originally avoided
> supporting the defaults internally to keep the code from bloating, but
> that might be a lame reason.
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to