summaryrefslogtreecommitdiffstats
path: root/test/test_helper.rb
diff options
context:
space:
mode:
authorZack Hobson2013-12-10 15:30:13 -0800
committerZack Hobson2013-12-10 15:30:13 -0800
commitc9d603a791e07e4e5b5dbd07cd7c5d1c27115d18 (patch)
tree8728dd0b6b019c9940f2434d41fe7cf4c8e34d31 /test/test_helper.rb
parent0d420ebc9d47d35ee2cf497f17a3b672b56537e0 (diff)
downloadhcl-c9d603a791e07e4e5b5dbd07cd7c5d1c27115d18.tar.bz2
silence during testing!
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r--test/test_helper.rb25
1 files changed, 20 insertions, 5 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index a09f25e..2fe445e 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -12,21 +12,36 @@ begin
minimum_coverage case RUBY_ENGINE
when "rbx" then 84
when "jruby" then 73
- else 77
+ else 78
end
end
rescue LoadError => e
$stderr.puts 'No test coverage tools found, skipping coverage check.'
end
+# override the default hcl dir
+ENV['HCL_DIR'] = File.dirname(__FILE__)+"/dot_hcl"
+require 'hcl'
+
require 'minitest/autorun'
require 'mocha/setup'
require 'fileutils'
require 'fakeweb'
-# override the default hcl dir
-ENV['HCL_DIR'] = File.dirname(__FILE__)+"/dot_hcl"
-
-require 'hcl'
+module IgnoreStderr
+ def before_setup
+ super
+ $stderr = @stderr = StringIO.new
+ $stdout = @stdout = StringIO.new
+ end
+ def after_teardown
+ super
+ $stderr = STDERR
+ $stdout = STDOUT
+ end
+end
+class HCl::TestCase < MiniTest::Unit::TestCase
+ include IgnoreStderr
+end