Last active
December 16, 2015 16:49
-
-
Save totty/5466521 to your computer and use it in GitHub Desktop.
ネット上では、COVERAGEなどの環境変数を設定して rake spec を実行する方法で simplecov 走らせる手段が散見してるが、それはそれで面倒なので、simplecov 用の rake タスクを作成しました。 「RAILS_ROOT/lib/tasks/spec.rake」としてファイルを配置して「rake spec:scov」で実行可能。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :spec do | |
desc "Run all specs with simplecov" | |
task :coverage do | |
require "simplecov" | |
SimpleCov.start "rails" | |
Rake::Task["spec"].execute | |
`open coverage/index.html` | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment