Skip to content

Instantly share code, notes, and snippets.

@totty
Last active December 16, 2015 16:49
Show Gist options
  • Save totty/5466521 to your computer and use it in GitHub Desktop.
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」で実行可能。
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