Permalink
Browse files

Update nanotest adapter

  • Loading branch information...
1 parent c8e1a3e commit 3614d3025a6a4a725eb1b6cba346a8413f736972 @mynyml committed Nov 27, 2009
Showing with 10 additions and 9 deletions.
  1. +1 −1 lib/redgreen.rb
  2. +7 −6 lib/redgreen/nanotest.rb
  3. +1 −1 test/nanotest/test_failure.rb
  4. +1 −1 test/nanotest/test_success.rb
View
@@ -16,5 +16,5 @@ def visual
if defined?(MiniTest::Unit::TestCase) then require dir.join('minitest')
elsif defined?(Test::Unit::TestCase) then require dir.join('testunit')
-elsif defined?(NanoTest) then require dir.join('nanotest')
+elsif defined?(Nanotest) then require dir.join('nanotest')
end
View
@@ -1,8 +1,9 @@
-at_exit do
- if NanoTest::FAILURES.empty?
- NanoTest::FAILURES << RedGreen.visual + "\n\n"
- else
- RedGreen.colour = :red
- NanoTest::FAILURES << RedGreen.visual + "\n\n"
+module Nanotest
+ class << self
+ alias :redgreen__orig_results :results
+ def results
+ RedGreen.colour = :red unless @@failures.empty?
+ redgreen__orig_results.strip + "\n" + RedGreen.visual + "\n\n"
+ end
end
end
@@ -1,5 +1,5 @@
require 'nanotest'
require 'lib/redgreen'
-include NanoTest
+include Nanotest
assert { false }
@@ -1,5 +1,5 @@
require 'nanotest'
require 'lib/redgreen'
-include NanoTest
+include Nanotest
assert { true }

0 comments on commit 3614d30

Please sign in to comment.