Permalink
Browse files

Use default assertion message even with nil arg

  • Loading branch information...
1 parent 20fad96 commit e00f2ff5baa315067a5983af9a21a51199a023ca @mynyml committed Nov 27, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/nanotest.rb
View
@@ -3,11 +3,11 @@ module Nanotest
@@failures, @@dots = [], []
- def assert(msg="assertion failed", file=nil, line=nil, &block)
+ def assert(msg=nil, file=nil, line=nil, &block)
unless block.call
file ||= caller.first.split(':')[0]
line ||= caller.first.split(':')[1]
- @@failures << "(%s:%0.3d) %s" % [file,line,msg]
+ @@failures << "(%s:%0.3d) %s" % [file, line, msg || "assertion failed"]
@@dots << 'F'
else
@@dots << '.'

0 comments on commit e00f2ff

Please sign in to comment.