I''m using the runt library [1] to do some temporal expression
matching. I want to keep the expression in a binary field in my db.
I figured that then in order to do the fixtures, I''d need to do some
erb in the yaml file. So I came up with this:
onetime:
id: 1
name: One Time
description: This event occurs only one time.
timex: <%= REYear.new(7) & REMonth.new(24) & REDay.new(3, 0, 17, 0)
%>
If I try to load in the fixture, I get the following error:
1) Error:
test_create(EventTest):
Fixture::FormatError: a YAML error occured parsing
/Users/pergesu/work/mesafire/config/../test/fixtures/events.yml.
Please note that YAML must be consistently indented using spaces. Tabs
are not allowed. Please have a look at http://www.yaml.org/faq.html
The exact error was:
NameError: uninitialized constant REYear
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/fixtures.rb:300:in
`read_fixture_files''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/fixtures.rb:275:in
`initialize''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/fixtures.rb:247:in
`new''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/fixtures.rb:247:in
`create_fixtures''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/fixtures.rb:246:in
`map''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/fixtures.rb:246:in
`create_fixtures''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/fixtures.rb:244:in
`silence''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/fixtures.rb:244:in
`create_fixtures''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/fixtures.rb:540:in
`load_fixtures''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/fixtures.rb:487:in
`setup''
I''ve put require ''runt'' in environtment.rb, the unit
test file, and
even in my yaml file doing <% require ''runt'' %>. Not
really sure how
I''m supposed to access this lib from the yaml file. I''d
really
appreciate any input.
Thanks,
Pat
[1] http://runt.rubyforge.org/