theIntuitionist / lite-fixtures
- Source
- Commits
- Network (0)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Tue Dec 16 16:00:15 -0800 2008 | |
| |
README | Sat Dec 27 22:35:33 -0800 2008 | |
| |
Rakefile | Fri Nov 21 10:03:02 -0800 2008 | |
| |
fixtures/ | Fri Nov 21 10:03:02 -0800 2008 | |
| |
init.rb | Fri Nov 21 10:06:27 -0800 2008 | |
| |
install.rb | Fri Nov 21 10:03:02 -0800 2008 | |
| |
lib/ | Fri Nov 21 14:22:02 -0800 2008 | |
| |
tasks/ | Fri Nov 21 14:22:02 -0800 2008 | |
| |
test/ | Fri Nov 21 14:22:02 -0800 2008 | |
| |
uninstall.rb | Fri Nov 21 10:03:02 -0800 2008 |
README
LiteFixtures
=============
INSTALL:
script/plugin install git://github.com/theIntuitionist/lite-fixtures.git
Lite Fixtures introduces two syntactical improvements to standard rails fixtures.
1) Patterns in fixture names
Using the pattern "(owners)s_(color)_(make)" in conjunction with the fixture
name "Freds_red_Ford" unpacks owner to Fred, color to red and make to Ford.
So:
(owners)s_(color)_(make):
Freds_red_Ford:
year: 1977
Eds_blue_Chevy:
year: 1987
Becomes
Freds_red_Ford:
owner: Fred
color: red
make: Ford
year: 1977
Eds_blue_Chevy:
owner: Ed
color: blue
make: Chevy
year: 1987
2) Grouping of Data
Often fixtures group cleanly- family of users, manufacturers of cars, etc. Lite fixtures lets you nest data, so
scoped values are propigated inward.
So:
red_fords:
make: ford
color: red
mustang:
owner: freddy
taurus:
owner: freddy
Becomes:
mustang:
make: ford
color: red
owner: freddy
taurus:
make: ford
color: red
owner: freddy
All the usual fixture features are still supported
Copyright (c) 2008 Jason Libsch, released under the MIT license
