Hi everyone, This may not be an issue, but I'm just checking. When I generate a scaffold in rails 2.1, all of the tests that get generated have a require 'test_helper' at the top. When you try to run a test individually through command line, you get an error: $ ruby test/functional/foos_controller_test.rb test/functional/foos_controller_test.rb:1:in `require': no such file to load -- ../test_helper (LoadError) Obviously changing this to require File.dirname(__FILE__) + "../test_helper" fixes the problem, however is there a rake task that lets you run tasks individually or is this just a bug? Sorry if I'm being nit-picky, but I like generators and think they should be kept up to date. :) TIA, -Lance
on 2008-06-24 08:36
on 2008-06-24 08:41
Sorry, require File.dirname(__FILE__) + "/../test_helper" I didn't test my test ;)
on 2008-06-24 08:56
Hi Lance -- On 24-Jun-08, at 2:35 AM, Lance Carlson wrote: > This may not be an issue, but I'm just checking. When I generate a > scaffold in rails 2.1, all of the tests that get generated have a > require 'test_helper' at the top. When you try to run a test > individually through command line, you get an error: > > $ ruby test/functional/foos_controller_test.rb > test/functional/foos_controller_test.rb:1:in `require': no such file > to load -- ../test_helper (LoadError) You can use the -I option to include the test dir in the load path when running from the command line: $ ruby -Itest test/functional/foos_controller_test.rb /Jeff
on 2008-06-24 15:41
On Tue, Jun 24, 2008 at 2:35 AM, Lance Carlson <lancecarlson@gmail.com> wrote: > to load -- ../test_helper (LoadError) > This sounds like a bug - many users will try to run the test directly either within textmate or their ide, or just by doing 'ruby foo_test.rb'. Using the relative path is the right way to go... - Rob
on 2008-06-24 15:50
У Ðўт, 24/06/2008 у 09:40 -0400, Rob Sanheim піша: > This sounds like a bug - many users will try to run the test directly > either within textmate or their ide, or just by doing 'ruby > foo_test.rb'. Using the relative path is the right way to go... +1 -- Aliaksey Kandratsenka <alkondratenko@gmail.com>
on 2008-06-24 16:03
It's being discussed here: http://github.com/rails/rails/commit/e8170805 -- Raul Murciano - Freelance Web Developer http://raul.murciano.net
on 2008-06-24 16:22
On Tue, Jun 24, 2008 at 9:59 AM, Raul Murciano <raul@murciano.net> wrote: > > It's being discussed here: http://github.com/rails/rails/commit/e8170805 > Great, only three places to check for core discussion now! Lighthouse, github, and here. ;) - Rob
on 2008-06-24 16:30
On Tue, Jun 24, 2008 at 7:21 AM, Rob Sanheim <rsanheim@gmail.com> wrote: > Great, only three places to check for core discussion now! > Lighthouse, github, and here. ;) Well, a ticket system and a mailing list are pretty traditional for Open Source projects. But using your SCM as a messaging platform? Come on, that's taking the social networking thing too far... I pray that I never see the official Twitter channel for an open source project I care about, because I ain't going there... -- Chad