Why when i run task :
my_project> rake import:twitter
Task.path: lib/task/import_twitter.rake
namespace :import do
task :twitter => :environment do
puts "importing...."
end
end
then tests also run?
In the console output:
importing....
Loaded suite C:/Ru开发者_StackOverflow社区by/bin/rake
Started
Finished in 0.001 seconds.
0 tests, 0 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifica
tions
0% passed
How not to run the tests, when the task is executed?
Hi You may write your task an then write new one that'll invoke two separate tasks - run tests and yours something like task :run_all => ['db:test:clone ', 'db:test:prepare ', 'test:units', :your_task]
There are no tests executed (you have always the count 0).
You get the test statistic always if you load test/unit
. Just try a file with:
require 'test/unit'
Can you check your rakefile, if you load anywhere test/unit
? (maybe it is in one of the required files) You may check $"
if it contains test/unit
Background:
test-unit starts at_exit
(script end) some routines and looks for test-methods inside children of Test::Unit::TestCase and executes them. After this, the statistic is written. Without tests, you get the 'empty' test statistic.
精彩评论