Permalink
Browse files

add minitest and bump to 0.0.2

  • Loading branch information...
1 parent 330871d commit 452925670c5b147a2b875d57d5ad07a274973c61 Sven Fuchs committed Apr 5, 2010
Showing with 9 additions and 9 deletions.
  1. +4 −6 lib/test_declarative.rb
  2. +1 −1 lib/test_declarative/version.rb
  3. +4 −2 test/test_declarative_test.rb
View
@@ -17,10 +17,8 @@ def self.test(name, &block)
end
end
-class Module
- include TestDeclarative
-end
+classes = [Module]
+classes << Test::Unit::TestCase if defined?(Test::Unit::TestCase)
+classes << MiniTest::Unit::TestCase if defined?(MiniTest::Unit::TestCase)
-class Test::Unit::TestCase
- include TestDeclarative
-end if defined?(Test::Unit::TestCase)
+classes.each { |c| c.send(:include, TestDeclarative) }
@@ -1,3 +1,3 @@
module TestDeclarative
- VERSION = '0.0.1'
+ VERSION = '0.0.2'
end
@@ -9,7 +9,9 @@ def test_responds_to_test
end
def test_adds_a_test_method
- self.class.test('foo')
- self.respond_to?(:'test_foo')
+ called = false
+ assert_nothing_raised { Test::Unit::TestCase.test('some test') { called = true } }
+ Test::Unit::TestCase.new(:'test_some_test').run(Test::Unit::TestResult.new) {}
+ assert called
end
end

0 comments on commit 4529256

Please sign in to comment.