Time load error when there are no tests
sevenseacat opened this issue · comments
/home/becky/.rbfu/rubies/1.9.3-p0/lib/ruby/gems/gems/rspec_junit_formatter-0.1.1/lib/rspec/core/formatters/j_unit_formatter.rb:18:in `dump_summary': undefined method `iso8601' for 2012-10-03 11:28:59 +0800:Time (NoMethodError)
Just spun up a brand new Ruby 1.9.3-p194 app up, tried to set everything up with Rspec as I normally would and came across this error when my app had no tests. Adding a test (even a failing one) fixed the problem - Rspec may be requiring 'time' in the process of running the test which then makes this formatter work as intended?
Yup, require "time"
will fix it. I should probably put that into the actual gem. Brb.
Wait, it's already in the file. And ruby 1.9.3's time class has this method. I have no idea what's happening to you.
Maybe try catching the exception and including $LOADED_FEATURES
? I can't replicate this locally...
Oh wait, it looks like I added that require because of this error, but didn't release a new version of the gem. I can't replicate this with my local git repo, but can with the gem install.
0.1.2 released with the line included which fixes the problem.