This project is archived and is in readonly mode.
script/generate model creates wrong unit test file
Reported by Anil Wadghule | May 18th, 2008 @ 01:32 PM
For latest edge Rails(Edge Rails revision 2463e38efd3cbcc10e7b0a93ad9c2d2224340668). When you generate model with "script/generate model user"
The file user_test.rb created in test/unit folder do not have line
require File.dirname(__FILE__) + '/../test_helper'
ruby 'test-helper'
which is wrong and so test fail until you make it correct.
Comments and changes to this ticket
-
DHH May 31st, 2008 @ 10:10 PM
- State changed from new to incomplete
The new approach is to use "ruby -I test user_test.rb".
-
DHH June 6th, 2008 @ 05:21 AM
No, rake does the right thing. The -I is only needed when you run one-off with ruby alone.
-
shuber June 6th, 2008 @ 06:46 AM
I've been changing the require calls back to
require File.dirname(__FILE__) + '/../test_helper'
so that I can still run the tests with TextMate's RubyMate
+1
-
Chris Cherry June 6th, 2008 @ 07:12 AM
This has been annoying me as well. This change doesn't alter other behavior, and allows the running of tests in TextMate!
+1
-
Jeremy Kemper June 6th, 2008 @ 08:31 AM
- State changed from incomplete to invalid
Fix TM to pass -Itest or use the rake test task.
-
Aliaksey Kandratsenka June 24th, 2008 @ 03:24 PM
In comment to http://github.com/rails/rails/co...
i proposed changing header to:
($: << File.expand_path(File.join(File.dirname(FILE), ".."))).uniq!
require ‘test_helper’
Another option is to generate full path to test_helper.rb and then #require it.
How about this ? I really hate creating separate emacs command to lauch tests.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>