test/test_helper.rb in cast-0.2.1 vs test/test_helper.rb in cast-0.3.0
- old
+ new
@@ -1,11 +1,14 @@
#!/usr/bin/env ruby
ROOT = File.expand_path('..', File.dirname(__FILE__))
$:.unshift "#{ROOT}/lib"
-require 'test/unit'
+require 'minitest'
+require 'minitest/autorun'
+require 'minitest/focus'
+require 'pry'
require 'stringio'
require 'fileutils'
require 'cast'
# a dir to cd into for creating files and such
@@ -34,11 +37,11 @@
def of(&blk)
Array.new(self, &blk)
end
end
-module Test::Unit::Assertions
+module Minitest::Assertions
INDENT = ' '
#
# Assert that the given string is parsed as expected. The given
# string is of the format:
#
@@ -69,11 +72,11 @@
C::Node::INSPECT_TAB*levels
end
# compare
msg = "Debug strings unequal:\n#{juxtapose('Expected', exp, 'Output', out)}"
- assert_block(msg){out == exp}
+ assert(out == exp, msg)
end
#
# Return a string of `s1' and `s2' side by side with a dividing line
# in between indicating differences. `h1' and `h2' are the column
# headings.
@@ -106,11 +109,11 @@
# Assert that an exception of the given class is raised, and that
# the message matches the given regex.
#
def assert_error(klass, re)
ex = nil
- assert_raise(klass) do
+ assert_raises(klass) do
begin
yield
rescue Exception => ex
raise
end
@@ -181,10 +184,10 @@
#
# Assert that out is ==, but not the same as exp (i.e., it is a
# copy).
#
def assert_copy(exp, out)
- assert_not_same exp, out
+ refute_same exp, out
assert_equal exp, out
end
#
# Assert the invariants of `node'.
#