Skip to content

Commit

Permalink
add minitest and bump to 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Fuchs committed Apr 5, 2010
1 parent 330871d commit 4529256
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 4 additions & 6 deletions lib/test_declarative.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ def self.test(name, &block)
end end
end end


class Module classes = [Module]
include TestDeclarative classes << Test::Unit::TestCase if defined?(Test::Unit::TestCase)
end classes << MiniTest::Unit::TestCase if defined?(MiniTest::Unit::TestCase)


class Test::Unit::TestCase classes.each { |c| c.send(:include, TestDeclarative) }
include TestDeclarative
end if defined?(Test::Unit::TestCase)
2 changes: 1 addition & 1 deletion lib/test_declarative/version.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,3 @@
module TestDeclarative module TestDeclarative
VERSION = '0.0.1' VERSION = '0.0.2'
end end
6 changes: 4 additions & 2 deletions test/test_declarative_test.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ def test_responds_to_test
end end


def test_adds_a_test_method def test_adds_a_test_method
self.class.test('foo') called = false
self.respond_to?(:'test_foo') 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
end end

0 comments on commit 4529256

Please sign in to comment.