Derek Haynes
2005-Oct-20 16:54 UTC
Unit Test Error: `load_specification'': undefined method `parse'' for Time:Class
All, I''ve come across a confusing problem when attempting to run unit tests for an application on OSX (works on Windows). I''m receiving the following error: `load_specification'': undefined method `parse'' for Time:Class (NoMethodError) This is also confusing because I can''t figure out how the error appeared. When I revert back to previous revisions, the error still appears (even though it didn''t in the past). I''m using Rails 0.13.1 and Ruby 1.8.2. Again, the error does not appear on Windows. Anyone come across this problem? Full stack trace below--- $ rake test_units (in /Users/james/Documents/Contract Jobs/HighGroove/robrady) /usr/local/bin/ruby -Ilib:test "/usr/local/lib/ruby/gems/1.8/gems/ rake-0.6.2/lib/rake/rake_test_loader.rb" "test/unit/account_test.rb" "test/unit/company_test.rb" "test/unit/contact_test.rb" "test/unit/ file_note_test.rb" "test/unit/file_status_test.rb" "test/unit/ file_type_test.rb" "test/unit/grade_test.rb" "test/unit/lab_test.rb" "test/unit/link_test.rb" "test/unit/localization_test.rb" "test/unit/ notification_test.rb" "test/unit/priority_test.rb" "test/unit/ role_test.rb" "test/unit/supplier_type_test.rb" "test/unit/ ticket_test.rb" /usr/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:74:in `load_specification'': undefined method `parse'' for Time:Class (NoMethodError) from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ specification.rb:307:in `date='' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ specification.rb:296:in `date='' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ specification.rb:384:in `send'' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ specification.rb:384:in `initialize'' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ specification.rb:383:in `each'' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ specification.rb:383:in `initialize'' from (eval):1:in `new'' from (eval):1:in `load_specification'' ... 24 levels... from /usr/local/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/ rake_test_loader.rb:5:in `load'' from /usr/local/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/ rake_test_loader.rb:5 from /usr/local/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/ rake_test_loader.rb:5:in `each'' from /usr/local/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/ rake_test_loader.rb:5 rake aborted! Command failed with status (1): [/usr/local/bin/ruby -Ilib:test "/usr/ local...] -- Derek Haynes HighGroove Studios - http://www.highgroove.com Keeping it Simple. 404.593.4879
Jamis Buck
2005-Oct-20 17:37 UTC
Re: Unit Test Error: `load_specification'': undefined method `parse'' for Time:Class
Derek, I''m not able to reproduce this using Rails 0.14.1. Could it be some other gem you have installed getting in the way? Like, a third-party Rails extension or something? Also, does putting require ''time'' in your environment.rb help at all? - Jamis On Oct 20, 2005, at 10:54 AM, Derek Haynes wrote:> All, > > I''ve come across a confusing problem when attempting to run unit tests > for an application on OSX (works on Windows). > > I''m receiving the following error: > > `load_specification'': undefined method `parse'' for Time:Class > (NoMethodError) > > This is also confusing because I can''t figure out how the error > appeared. When I revert back to previous revisions, the error still > appears (even though it didn''t in the past). > > I''m using Rails 0.13.1 and Ruby 1.8.2. Again, the error does not > appear on Windows. > > Anyone come across this problem? > > Full stack trace below--- > > $ rake test_units > (in /Users/james/Documents/Contract Jobs/HighGroove/robrady) > /usr/local/bin/ruby -Ilib:test "/usr/local/lib/ruby/gems/1.8/gems/ > rake-0.6.2/lib/rake/rake_test_loader.rb" "test/unit/account_test.rb" > "test/unit/company_test.rb" "test/unit/contact_test.rb" "test/unit/ > file_note_test.rb" "test/unit/file_status_test.rb" "test/unit/ > file_type_test.rb" "test/unit/grade_test.rb" "test/unit/lab_test.rb" > "test/unit/link_test.rb" "test/unit/localization_test.rb" "test/unit/ > notification_test.rb" "test/unit/priority_test.rb" "test/unit/ > role_test.rb" "test/unit/supplier_type_test.rb" "test/unit/ > ticket_test.rb" > /usr/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:74:in > `load_specification'': undefined method `parse'' for Time:Class > (NoMethodError) > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ > specification.rb:307:in `date='' > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ > specification.rb:296:in `date='' > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ > specification.rb:384:in `send'' > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ > specification.rb:384:in `initialize'' > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ > specification.rb:383:in `each'' > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ > specification.rb:383:in `initialize'' > from (eval):1:in `new'' > from (eval):1:in `load_specification'' > ... 24 levels... > from /usr/local/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/ > rake_test_loader.rb:5:in `load'' > from /usr/local/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/ > rake_test_loader.rb:5 > from /usr/local/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/ > rake_test_loader.rb:5:in `each'' > from /usr/local/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/ > rake_test_loader.rb:5 > rake aborted! > Command failed with status (1): [/usr/local/bin/ruby -Ilib:test "/usr/ > local...] > -- > Derek Haynes > HighGroove Studios - http://www.highgroove.com > Keeping it Simple. > 404.593.4879 > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Derek Haynes
2005-Oct-20 18:43 UTC
Re: Unit Test Error: `load_specification'': undefined method `parse'' for Time:Class
Jamis, Thanks for the hint. The problem occurs with the salted login generator. Removing test/mocks/time.rb fixes the problem and all tests pass. Thanks again, Derek On 10/20/05, Jamis Buck <jamis-uHoyYlH2B+GakBO8gow8eQ@public.gmane.org> wrote:> Derek, > > I''m not able to reproduce this using Rails 0.14.1. Could it be some > other gem you have installed getting in the way? Like, a third-party > Rails extension or something? > > Also, does putting > > require ''time'' > > in your environment.rb help at all? > > - Jamis > > On Oct 20, 2005, at 10:54 AM, Derek Haynes wrote: > > > All, > > > > I''ve come across a confusing problem when attempting to run unit tests > > for an application on OSX (works on Windows). > > > > I''m receiving the following error: > > > > `load_specification'': undefined method `parse'' for Time:Class > > (NoMethodError) > > > > This is also confusing because I can''t figure out how the error > > appeared. When I revert back to previous revisions, the error still > > appears (even though it didn''t in the past). > > > > I''m using Rails 0.13.1 and Ruby 1.8.2. Again, the error does not > > appear on Windows. > > > > Anyone come across this problem? > > > > Full stack trace below--- > > > > $ rake test_units > > (in /Users/james/Documents/Contract Jobs/HighGroove/robrady) > > /usr/local/bin/ruby -Ilib:test "/usr/local/lib/ruby/gems/1.8/gems/ > > rake-0.6.2/lib/rake/rake_test_loader.rb" "test/unit/account_test.rb" > > "test/unit/company_test.rb" "test/unit/contact_test.rb" "test/unit/ > > file_note_test.rb" "test/unit/file_status_test.rb" "test/unit/ > > file_type_test.rb" "test/unit/grade_test.rb" "test/unit/lab_test.rb" > > "test/unit/link_test.rb" "test/unit/localization_test.rb" "test/unit/ > > notification_test.rb" "test/unit/priority_test.rb" "test/unit/ > > role_test.rb" "test/unit/supplier_type_test.rb" "test/unit/ > > ticket_test.rb" > > /usr/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:74:in > > `load_specification'': undefined method `parse'' for Time:Class > > (NoMethodError) > > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ > > specification.rb:307:in `date='' > > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ > > specification.rb:296:in `date='' > > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ > > specification.rb:384:in `send'' > > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ > > specification.rb:384:in `initialize'' > > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ > > specification.rb:383:in `each'' > > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ > > specification.rb:383:in `initialize'' > > from (eval):1:in `new'' > > from (eval):1:in `load_specification'' > > ... 24 levels... > > from /usr/local/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/ > > rake_test_loader.rb:5:in `load'' > > from /usr/local/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/ > > rake_test_loader.rb:5 > > from /usr/local/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/ > > rake_test_loader.rb:5:in `each'' > > from /usr/local/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/ > > rake_test_loader.rb:5 > > rake aborted! > > Command failed with status (1): [/usr/local/bin/ruby -Ilib:test "/usr/ > > local...] > > -- > > Derek Haynes > > HighGroove Studios - http://www.highgroove.com > > Keeping it Simple. > > 404.593.4879 > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Derek Haynes HighGroove Studios - http://www.highgroove.com Keeping it Simple. 404.593.4879
Deirdre Saoirse Moen
2005-Oct-22 21:27 UTC
Re: Unit Test Error: `load_specification'': undefined method `parse'' for Time:Class
On Oct 20, 2005, at 11:43 AM, Derek Haynes wrote:> Jamis, > > Thanks for the hint. > > The problem occurs with the salted login generator. Removing > test/mocks/time.rb fixes the problem and all tests pass.Yes, well, I don''t know of anyone who''s been able to use the salted hash login generator without problems.
Jamis Buck
2005-Oct-22 23:01 UTC
Re: Unit Test Error: `load_specification'': undefined method `parse'' for Time:Class
On Oct 22, 2005, at 3:27 PM, Deirdre Saoirse Moen wrote:> On Oct 20, 2005, at 11:43 AM, Derek Haynes wrote: > >> Jamis, >> >> Thanks for the hint. >> >> The problem occurs with the salted login generator. Removing >> test/mocks/time.rb fixes the problem and all tests pass. >> > > Yes, well, I don''t know of anyone who''s been able to use the salted > hash login generator without problems.I''m going to be wildly unpredicable here, and suggest that the salted hash login generator might make a better plugin than a generator... Anyone want to test that? - Jamis
Deirdre Saoirse Moen
2005-Oct-22 23:09 UTC
Re: Unit Test Error: `load_specification'': undefined method `parse'' for Time:Class
On Oct 22, 2005, at 4:01 PM, Jamis Buck wrote:> On Oct 22, 2005, at 3:27 PM, Deirdre Saoirse Moen wrote: > >> Yes, well, I don''t know of anyone who''s been able to use the >> salted hash login generator without problems. > > I''m going to be wildly unpredicable here, and suggest that the > salted hash login generator might make a better plugin than a > generator... Anyone want to test that?It is already in progress. I''m sure someone will announce at the right time. Rick Olson, for example. -- _Deirdre http://deirdre.net