test/helper.rb in assert-0.1.0 vs test/helper.rb in assert-0.2.0
- old
+ new
@@ -1,10 +1,13 @@
# this file is automatically required in when you require 'test_belt'
# put test helpers here
require 'stringio'
+# test/.. (root dir for gem)
+$LOAD_PATH.unshift(File.expand_path("../..", __FILE__))
+
# This is the suite intended to be used in the tests, this is seperate from Assert.suite which is
# the actual suite being used to run the tests, confused? Don't use Assert.suite in your tests,
# use TEST_ASSERT_SUITE
TEST_ASSERT_SUITE = Assert::Suite.new
@@ -36,12 +39,12 @@
# Common interface for generating a new test, takes args and a block, will default everything
# if you need a no-op test.
def test(*args, &block)
name = (args[0] || "a test").to_s
context_class = args[1] || self.context_class
- block ||= (args[2] || lambda{ })
+ test_block = (block || args[2] || ::Proc.new{})
- Assert::Test.new(name, context_class, &block)
+ Assert::Test.new(name, context_class, &test_block)
end
# Common interface for generating a new skip result
def skip_result(name, exception)
Assert::Result::Skip.new(name, exception)