commit f14b03b2e49993a1d4d9838e7acb70a52618875e
parent a3464c514a8d739ab1ffb1e7f7b526843538904c
Author: Whyme Lyu <callme5long@gmail.com>
Date: Thu, 16 May 2013 23:49:50 +0800
Use Minitest, which is awesome
Diffstat:
5 files changed, 13 insertions(+), 19 deletions(-)
diff --git a/sup.gemspec b/sup.gemspec
@@ -47,5 +47,6 @@ DESC
s.add_development_dependency "bundler", "~> 1.3"
s.add_development_dependency "rake"
+ s.add_development_dependency "minitest", "~> 4"
end
end
diff --git a/test/test_header_parsing.rb b/test/test_header_parsing.rb
@@ -1,12 +1,12 @@
#!/usr/bin/ruby
-require 'test/unit'
+require 'test_helper'
require 'sup'
require 'stringio'
include Redwood
-class TestMBoxParsing < Test::Unit::TestCase
+class TestMBoxParsing < Minitest::Unit::TestCase
def setup
@path = Dir.mktmpdir
@@ -150,10 +150,10 @@ To: a dear friend
Hello again! Would you like to buy my products?
EOS
offset = l.next_offset 0
- assert_not_nil offset
+ refute_nil offset
offset = l.next_offset offset
- assert_not_nil offset
+ refute_nil offset
offset = l.next_offset offset
assert_nil offset
diff --git a/test/test_helper.rb b/test/test_helper.rb
@@ -0,0 +1 @@
+require 'minitest/autorun'
diff --git a/test/test_message.rb b/test/test_message.rb
@@ -1,6 +1,6 @@
#!/usr/bin/ruby
-require 'test/unit'
+require 'test_helper'
require 'sup'
require 'stringio'
@@ -26,7 +26,7 @@ end
module Redwood
-class TestMessage < Test::Unit::TestCase
+class TestMessage < ::Minitest::Unit::TestCase
def setup
@path = Dir.mktmpdir
@@ -289,7 +289,7 @@ EOS
from = sup_message.from
# very basic email address check
assert_match(/\w+@\w+\.\w{2,4}/, from.email)
- assert_not_nil(from.name)
+ refute_nil(from.name)
end
@@ -327,11 +327,7 @@ EOS
# read the message body chunks: no errors should reach this level
- chunks = nil
-
- assert_nothing_raised() do
- chunks = sup_message.load_from_source!
- end
+ chunks = sup_message.load_from_source!
# the chunks list should be empty
@@ -426,10 +422,7 @@ EOS
# read the message body chunks
- assert_nothing_raised() do
- chunks = sup_message.load_from_source!
- end
-
+ sup_message.load_from_source!
end
def test_blank_header_lines
@@ -537,4 +530,3 @@ end
end
# vim:noai:ts=2:sw=2:
-
diff --git a/test/test_yaml_regressions.rb b/test/test_yaml_regressions.rb
@@ -1,4 +1,4 @@
-require 'test/unit'
+require 'test_helper'
# Requiring 'yaml' before 'sup' in 1.9.x would get Psych loaded first
# and becoming the default yamler.
@@ -6,7 +6,7 @@ require 'yaml'
require 'sup'
module Redwood
- class TestYamlRegressions < Test::Unit::TestCase
+ class TestYamlRegressions < ::Minitest::Unit::TestCase
def test_yamling_hash
hsh = {:foo => 42}
reloaded = YAML.load(hsh.to_yaml)