#537: Missing Time#strftime formatter: "%P" -------------------------------+-------------------------------------------- Reporter: bburky@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: MacRuby Later Component: MacRuby | Keywords: -------------------------------+-------------------------------------------- Comment(by danielcavanagh@…): Okay, here it is. It also implements subsecs and Time as Rational in what is probably a very ugly way It passes all the rspec time specs except for the following 5: 1) Time#+ adds a negative Float FAILED - Expected 700000 to equal 699999 2) Time#strftime returns the date alone with %x FAILED - Expected "18/09/09" to equal "09/18/09" 3) Time#strftime returns the time alone with %X FAILED - Expected "12:00 PM" to equal "12:00:06" 4) Time#to_r returns the rational number of seconds + usecs since the epoch FAILED - Expected (1209462791653111237151/1099511627776000000000) to equal (619244948763443/562949953421312) 5) Time#usec returns the microseconds for time FAILED - Expected 899999 to equal 900000 2 & 3 are invalid tests as far as I'm concerned, because %x and %X are defined as "preferred representation", which obviously differs depending on your region and system 1 & 5 are off-by-ones involving floats. I don't know anything about floats but I'm guessing this is just a difference between our float implementations (perhaps ultimately because of hardware?), and considering floats are not designed to represent whole numbers this might be considered allowable 4 is because of a difference between our Rational implementations. I'm not even going to go there... spec:ci aborts pretty early on with and without the patch, but it does abort a little bit earlier than normal with the patch so I guess that shows a regression. I have no idea how to get it to tell me what test it is running when it aborts though and don't feel like hacking up rspec at the moment just to work it out, so I'll leave that to someone else Hopefully you don't need to hack it into shape too much more :p Feel free to ask questions -- Ticket URL: <http://www.macruby.org/trac/ticket/537#comment:9> MacRuby <http://macruby.org/>