Sto usando Rails 4.0.0.beta1. Ho aggiunto due directory: app/services
e test/services
.rake: test non eseguito test personalizzati nella sottodirectory
Ho anche aggiunto questo codice, basato sulla lettura testing.rake of railties:
namespace :test do
Rake::TestTask.new(services: "test:prepare") do |t|
t.libs << "test"
t.pattern = 'test/services/**/*_test.rb'
end
end
Ho scoperto che rake test:services
esegue i test in test/services
; tuttavia, rake test
non esegue questi test. Sembra che sia; ecco il code:
Rake::TestTask.new(:all) do |t|
t.libs << "test"
t.pattern = "test/**/*_test.rb"
end
Ho trascurato qualcosa?
Buon punto: 'test' e' test: all' compiti sono diversi. –
Ri: "Non so perché non vengono automaticamente rilevati" - Non so se questo è intenzionale, o semplicemente un'asimmetria sviluppata come le modifiche sono state apportate. Così ho aggiunto un [commento sulla richiesta pull che ha aggiunto il test: all task] (https://github.com/rails/rails/pull/9177#issuecomment-14575192). –
Grazie mille, Jim. – Ashitaka