Sunday, November 23, 2008

Rails config for concordion

I am working with rcor, a ruby port of concordion, and I have run into a little setback working with Rails. RCor searches the $LOAD_PATH to find the html specifications, so I decided to add it to the standard config/test.rb. Here was the output:
new-host:rcor-spike ariel$ rake test
(in /Users/ariel/Documents/dev/bookstore)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -Ilib:test "/Users/ariel/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb" "test/unit/book_test.rb" "test/unit/hello_world_test.rb"
Loaded suite /Users/ariel/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader
Started
...E
Finished in 0.073126 seconds.

1) Error:
test_spec(HelloWorldTest):
RuntimeError: Could not find hello_world.html on the system load path!
/Users/ariel/.gem/ruby/1.8/gems/rcor-0.7.0/lib/concordion_reader.rb:15:in `find_on_load_path'
/Users/ariel/.gem/ruby/1.8/gems/rcor-0.7.0/lib/concordion_reader.rb:4:in `read'
/Users/ariel/.gem/ruby/1.8/gems/rcor-0.7.0/lib/concordion_parser.rb:22:in `parse'
/Users/ariel/.gem/ruby/1.8/gems/rcor-0.7.0/lib/concordion_test_case.rb:69:in `parse_spec'
/Users/ariel/.gem/ruby/1.8/gems/rcor-0.7.0/lib/concordion_test_case.rb:22:in `test_spec'
/Users/ariel/.gem/ruby/1.8/gems/activesupport-2.1.1/lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
/Users/ariel/.gem/ruby/1.8/gems/activesupport-2.1.1/lib/active_support/testing/setup_and_teardown.rb:67:in `run'

4 tests, 3 assertions, 0 failures, 1 errors

Really? Well it doesn't work. I had to add the following line to my config/environment.rb: config.load_paths += %W( #{RAILS_ROOT}/test/acceptance ) if ENV['RAILS_ENV'] == 'test'
WhyTF do I have to do this? Rather than STFW or RTFM I am blogging about it. Talk about open-closed jeez!!!

No comments: