aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/test_info_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-04-05 17:06:36 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-04-05 17:06:36 -0700
commit2e0e5bb1e4ee5836572fffe6e3f16eefd56b4a25 (patch)
tree5587c7e3183d9e4da6df4cc909e4c47ad1d5de21 /railties/test/test_info_test.rb
parent88cf64a6690e3c7cc05bd644bd5ad9a000192ebd (diff)
downloadrails-2e0e5bb1e4ee5836572fffe6e3f16eefd56b4a25.tar.gz
rails-2e0e5bb1e4ee5836572fffe6e3f16eefd56b4a25.tar.bz2
rails-2e0e5bb1e4ee5836572fffe6e3f16eefd56b4a25.zip
rake test app/model/foo.rb and rake test models/foo works
Diffstat (limited to 'railties/test/test_info_test.rb')
-rw-r--r--railties/test/test_info_test.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/railties/test/test_info_test.rb b/railties/test/test_info_test.rb
index 2f78dcff1b..d5463c11de 100644
--- a/railties/test/test_info_test.rb
+++ b/railties/test/test_info_test.rb
@@ -24,6 +24,30 @@ module Rails
assert_equal ['test'], info.tasks
end
+ def test_with_model_shorthand
+ info = new_test_info ['test', 'models/foo', '/foo/']
+
+ def info.test_file?(file)
+ file == "test/models/foo_test.rb" || super
+ end
+
+ assert_equal ['test/models/foo_test.rb'], info.files
+ assert_equal '-n /foo/', info.opts
+ assert_equal ['test'], info.tasks
+ end
+
+ def test_with_model_path
+ info = new_test_info ['test', 'app/models/foo.rb', '/foo/']
+
+ def info.test_file?(file)
+ file == "test/models/foo_test.rb" || super
+ end
+
+ assert_equal ['test/models/foo_test.rb'], info.files
+ assert_equal '-n /foo/', info.opts
+ assert_equal ['test'], info.tasks
+ end
+
def new_test_info(tasks)
Class.new(TestTask::TestInfo) {
def task_defined?(task)