summaryrefslogtreecommitdiffstats
path: root/test
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
parent0d420ebc9d47d35ee2cf497f17a3b672b56537e0 (diff)
downloadhcl-c9d603a791e07e4e5b5dbd07cd7c5d1c27115d18.tar.bz2
silence during testing!
Diffstat (limited to 'test')
-rw-r--r--test/app_test.rb2
-rw-r--r--test/command_test.rb2
-rw-r--r--test/day_entry_test.rb2
-rw-r--r--test/task_test.rb2
-rw-r--r--test/test_helper.rb25
-rw-r--r--test/timesheet_resource_test.rb2
-rw-r--r--test/utility_test.rb2
7 files changed, 26 insertions, 11 deletions
diff --git a/test/app_test.rb b/test/app_test.rb
index c533076..c9496c0 100644
--- a/test/app_test.rb
+++ b/test/app_test.rb
@@ -1,5 +1,5 @@
require 'test_helper'
-class AppTest < MiniTest::Unit::TestCase
+class AppTest < HCl::TestCase
def setup
# touch config to avoid triggering manual config
diff --git a/test/command_test.rb b/test/command_test.rb
index 61d9f22..b554bfd 100644
--- a/test/command_test.rb
+++ b/test/command_test.rb
@@ -1,5 +1,5 @@
require 'test_helper'
-class CommandTest < MiniTest::Unit::TestCase
+class CommandTest < HCl::TestCase
include HCl::Commands
include HCl::Utility
diff --git a/test/day_entry_test.rb b/test/day_entry_test.rb
index 8b68348..5b390c3 100644
--- a/test/day_entry_test.rb
+++ b/test/day_entry_test.rb
@@ -1,6 +1,6 @@
require 'test_helper'
-class DayEntryTest < MiniTest::Unit::TestCase
+class DayEntryTest < HCl::TestCase
def test_from_xml
entries = HCl::DayEntry.from_xml(<<-EOD)
<daily>
diff --git a/test/task_test.rb b/test/task_test.rb
index ecffdb5..e313f73 100644
--- a/test/task_test.rb
+++ b/test/task_test.rb
@@ -1,5 +1,5 @@
-class Task < MiniTest::Unit::TestCase
+class Task < HCl::TestCase
def test_cache_file
assert_equal "#{HCl::App::HCL_DIR}/cache/tasks.yml", HCl::Task.cache_file
end
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
diff --git a/test/timesheet_resource_test.rb b/test/timesheet_resource_test.rb
index 0ef6da1..4153429 100644
--- a/test/timesheet_resource_test.rb
+++ b/test/timesheet_resource_test.rb
@@ -1,6 +1,6 @@
require 'test_helper'
-class TimesheetResourceTest < MiniTest::Unit::TestCase
+class TimesheetResourceTest < HCl::TestCase
def setup
FakeWeb.allow_net_connect = false
diff --git a/test/utility_test.rb b/test/utility_test.rb
index f0652a0..adc55b6 100644
--- a/test/utility_test.rb
+++ b/test/utility_test.rb
@@ -1,6 +1,6 @@
require 'test_helper'
-class UtilityTest < MiniTest::Unit::TestCase
+class UtilityTest < HCl::TestCase
include HCl::Utility
def test_time2float_decimal