Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion devel/levitate.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

class Levitate
include Rake::DSL

def initialize(gem_name)
@gem_name = gem_name

Expand Down Expand Up @@ -336,7 +338,13 @@ def define_test
test_files.each { |file| require file }

# if we use at_exit hook instead, it won't run before :release
MiniTest::Unit.new.run ARGV
if MiniTest::Unit.method_defined? :run
# minitest 4
MiniTest::Unit.new.run ARGV
else
# minitest 5
Minitest.run ARGV
end
end

desc "run tests with coverage"
Expand Down
1 change: 1 addition & 0 deletions test/comp_tree_test_base.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../devel'

gem 'minitest'
require 'minitest/unit'
require 'minitest/autorun' unless defined? Rake
require 'comp_tree'
Expand Down
4 changes: 2 additions & 2 deletions test/exception_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def test_exception
)

if define_all
assert_block { error.is_a? test_error }
assert ( error.is_a? test_error )
else
assert_block { error.is_a? CompTree::NoFunctionError }
assert ( error.is_a? CompTree::NoFunctionError )
assert_equal(
"no function was defined for node `:border'",
error.message
Expand Down
4 changes: 2 additions & 2 deletions test/throw_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class ThrowTest < CompTreeTest
EXPECTED = RUBY_VERSION >= "1.9.0" ? ArgumentError : ThreadError

def test_throw
assert_equal 1, Thread.list.size
init_size = Thread.list.size
exception = assert_raises(EXPECTED) {
CompTree.build do |driver|
driver.define(:root, :a) {
Expand All @@ -17,6 +17,6 @@ def test_throw
end
}
assert_match "uncaught", exception.message
assert_equal 1, Thread.list.size
assert_equal init_size, Thread.list.size
end
end