P
Patrick Spence
I need to subclass Test::Unit::Assertions so I can log the assertions as
they are being, uhh... "asserted". The following is giving me a "parse
error, unexpected '<'" on the line indicated below.
require 'test/unit/assertions'
module Test
module Unit
module MhiqAssertions < Assertions # <-- PARSE ERROR!
#overloaded Test::Unit::Assertions.assert()
def assert(boolean, message=nil)
#wrap the assertion
_wrap_assertion do
assert_block("assert should not be called with a block.") {
!block_given? }
assert_block(build_message(message, "<?> is not true.",
boolean)) { boolean }
#-- log the assertion here
end ## do
end ## method assert()
end ## module MhiqAssertions
end ## module Unit
end ## module Test
they are being, uhh... "asserted". The following is giving me a "parse
error, unexpected '<'" on the line indicated below.
require 'test/unit/assertions'
module Test
module Unit
module MhiqAssertions < Assertions # <-- PARSE ERROR!
#overloaded Test::Unit::Assertions.assert()
def assert(boolean, message=nil)
#wrap the assertion
_wrap_assertion do
assert_block("assert should not be called with a block.") {
!block_given? }
assert_block(build_message(message, "<?> is not true.",
boolean)) { boolean }
#-- log the assertion here
end ## do
end ## method assert()
end ## module MhiqAssertions
end ## module Unit
end ## module Test