ruby on rails 3 - Run all models tests using rake task -


trying use rake task run tests in test/models directory. using minitest.

i have rake task run test

  require "rake/testtask"    rake::testtask.new(:test => "db:test:prepare") |t|      t.libs << "test"     t.pattern = "test/**/*_test.rb"  end   task :default => :test 

then, running 'rake' hits default , runs tests. want write second rake task run tests in models directory (test/models/).

i played around existing testtask changing

t.pattern = "test/**/*_test.rb" 

to

t.pattern = "test/models/*_test.rb" 

but, seems still run tests...not models. strange?

questions

how can accomplish this? how need name second testtask run models, , how tell rake run test instead of default :test?

the pattern looking "test/models/**/*_test.rb". "**" match subdirectories well.

if using minitest-rails have lots of tasks added you. run model tests run:

rake minitest:models 

to see rake tasks creates you, run:

rake -t 

Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -