aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2015-08-05 20:00:24 +0900
committerKazuki Yamaguchi <k@rhe.jp>2015-08-05 20:00:24 +0900
commit4c9a3e5beac9829a6852b3f05735b102c6b55247 (patch)
tree12082da1d6bfff3fd5f95b693de2c5e16dccd3ad
parentfae30116e3029d2a58f2fee8bead2491d6af2acc (diff)
downloadplum-4c9a3e5beac9829a6852b3f05735b102c6b55247.tar.gz
test: skip simplecov when guard autotest
-rw-r--r--Guardfile10
-rw-r--r--test/test_helper.rb25
2 files changed, 19 insertions, 16 deletions
diff --git a/Guardfile b/Guardfile
index 5288aec..d5d95f4 100644
--- a/Guardfile
+++ b/Guardfile
@@ -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