Permalink
Browse files

Tweaks to newline placement to avoid disaster with Logger

  • Loading branch information...
1 parent b94b010 commit 191a2377f7418a63d42efcad099eaaaec4eba27a @peterc committed Aug 14, 2011
Showing with 10 additions and 8 deletions.
  1. +2 −0 README.md
  2. +8 −8 lib/testrocket.rb
View
@@ -54,6 +54,8 @@ By default, output is written to STDOUT (as well as returned by the test express
TestRocket.out = File.new('/dev/null', 'w')
+TestRocket.out also supports Logger instances.
+
Authors
-------
View
@@ -5,15 +5,15 @@ def _test(a, b)
send((call rescue()) ? a : b)
end
- def +@; r = _test :_pass, :_fail; (TestRocket.out || $>) << r << "\n"; r end
- def -@; r = _test :_fail, :_pass; (TestRocket.out || $>) << r << "\n"; r end
- def ~@; r = _pend; (TestRocket.out || $>) << r << "\n"; r end
- def !@; r = _desc; (TestRocket.out || $>) << r << "\n"; r end
+ def +@; r = _test :_pass, :_fail; (TestRocket.out || $>) << r; r end
+ def -@; r = _test :_fail, :_pass; (TestRocket.out || $>) << r; r end
+ def ~@; r = _pend; (TestRocket.out || $>) << r; r end
+ def !@; r = _desc; (TestRocket.out || $>) << r; r end
- def _pass; " OK"; end
- def _fail; " FAIL @ #{source_location.join(':')}"; end
- def _pend; "PENDING '#{call.to_s}' @ #{source_location.join(':')}"; end
- def _desc; " FIRE '#{call.to_s}'!"; end
+ def _pass; " OK\n"; end
+ def _fail; " FAIL @ #{source_location.join(':')}\n"; end
+ def _pend; "PENDING '#{call.to_s}' @ #{source_location.join(':')}\n"; end
+ def _desc; " FIRE '#{call.to_s}'!\n"; end
end
Proc.send :include, TestRocket

0 comments on commit 191a237

Please sign in to comment.