Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
problems overriding Date#inspect in a file required in a test
mmalaidini
4/14/2008 9:10:00 PM
With reference to the previous thread
http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/0402853...
("change usage of pp in Test::Unit assertions"), I'm finding something
that I consider very odd.
Basically, I wanted to override Date#inspect in one place only, a
small and nice common.rb file that I include anywhere else. For the
same reasons, I wanted to say use_pp=false there only.
This is the content of common.rb file:
class Date
def inspect
to_s
end
end
Test::Unit::Assertions.use_pp = false
It seems that if I require this file in my test, nothing changes, Date
instances are still printed using PP. The only way to make it work is
through overriding inspect directly in the test file.
Is there something obvious about require and test/unit that I'm
missing here?
Thanks
MM
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
problems overriding Date#inspect in a file required in a test
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password