문제

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:/Ruby/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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top