diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2015-08-05 20:00:24 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2015-08-05 20:00:24 +0900 |
commit | 4c9a3e5beac9829a6852b3f05735b102c6b55247 (patch) | |
tree | 12082da1d6bfff3fd5f95b693de2c5e16dccd3ad | |
parent | fae30116e3029d2a58f2fee8bead2491d6af2acc (diff) | |
download | plum-4c9a3e5beac9829a6852b3f05735b102c6b55247.tar.gz |
test: skip simplecov when guard autotest
-rw-r--r-- | Guardfile | 10 | ||||
-rw-r--r-- | test/test_helper.rb | 25 |
2 files changed, 19 insertions, 16 deletions
@@ -1,8 +1,10 @@ -guard :minitest do +guard :minitest, env: { "SKIP_COVERAGE" => true } do # with Minitest::Unit - watch(%r{^test/(.*)\/?test_(.*)\.rb$}) - watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" } - watch(%r{^test/test_helper\.rb$}) { 'test' } + watch(%r{^test/(.*)_test\.rb$}) + watch(%r{^test/test_helper\.rb$}) { "test" } + watch(%r{^test/utils\.rb$}) { "test" } + watch(%r{^lib/plum.rb$}) { "test" } + watch(%r{^lib/plum/(.+)\.rb$}) {|m| "test/" + m[1].gsub("/", "_") + "_test.rb" } # with Minitest::Spec # watch(%r{^spec/(.*)_spec\.rb$}) diff --git a/test/test_helper.rb b/test/test_helper.rb index 80cba9d..de01442 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,14 +1,16 @@ -begin - require "simplecov" - require "codeclimate-test-reporter" - SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ - SimpleCov::Formatter::HTMLFormatter, - CodeClimate::TestReporter::Formatter - ] - SimpleCov.start do - add_filter "test/" +unless ENV["SKIP_COVERAGE"] + begin + require "simplecov" + require "codeclimate-test-reporter" + SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ + SimpleCov::Formatter::HTMLFormatter, + CodeClimate::TestReporter::Formatter + ] + SimpleCov.start do + add_filter "test/" + end + rescue LoadError end -rescue LoadError end require "plum" @@ -19,6 +21,5 @@ require "minitest/autorun" require "minitest/pride" require "utils" -LISTEN_PORT = ENV["PLUM_LISTEN_PORT"] || 40444 - include Plum +LISTEN_PORT = ENV["PLUM_LISTEN_PORT"] || 40444 |