public
Description: Succinct, expressive fixture syntax for Ruby on Rails projects
Homepage:
Clone URL: git://github.com/theIntuitionist/lite-fixtures.git
lite-fixtures / README
100644 69 lines (46 sloc) 1.442 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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