Help me understand why this project's tests run when executed directly but do not when run via rake. The error when run via a Rake TestTask:
** Execute test
/home/myockey/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -I"lib:test" "/home/myockey/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/unit/data_test.rb" "test/unit/station_test.rb" "test/unit/raw_test.rb" "test/unit/parser_test.rb" "test/unit/report_test.rb"
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- test/unit/../metar_test_helper.rb (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from test/unit/data_test.rb:4:in `<top (required)>'
from /home/myockey/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load'
from /home/myockey/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `block in <main>'
from /home/myockey/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each'
from /home/myockey/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `<main>'
rake aborted!
When I run the script directly I get the following:
myockey@myockey-K61IC:~/opt/joeyates-metar-parser-cdca19f/test/unit$ ruby data_test.rb
Loaded suite data_test
Started
...................................................
Finished in 0.084939 seconds.
51 tests, 121 assertions, 0 failures, 0 errors, 0 skips
The top of the ruby files looks like this:
#!/usr/bin/env ruby
# encoding: utf-8
require File.dirname(__FILE__) + '/../metar_test_helper'
class TestMetarData < Test::Unit::TestCase
Note that I tried adding the .rb file extension to metar_test_helper to no avail. Rest assured that a file named metar_test_helper.rb exists in the parent directory of the file and that it has sufficient permissions to be accessible.
Added a bounty. I know this must be a simple path issue, but I'd really appreciate some guidance solving it and helping me understand it.