Hello, I''m trying to use the salted login generator and having several problems. The first is that, when I run the tests with rake, I get the error pasted below. /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:5: undefined method `cattr_accessor'' for Time:Class (NoMethodError) I have tried putting "require ''active_support''" (I think that''s where cattr_accessor lives) at the top of test/time.rb but that results in the following: /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:3:in `require'': no such file to load -- active_support (LoadError) Shouldn''t all the rails libs be loaded and ready for use by the tests? I''m still fairly new to ruby and how the require mechanism works. For completeness, here''s the complete stack trace accompanying the first error message above: /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:7: undefined method `cattr_accessor'' for Time:Class (NoMethodError) from /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:5:in `class_eval'' from /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:5 from /usr/local/lib/site_ruby/1.8/rubygems/specification.rb:1 from /usr/local/lib/site_ruby/1.8/rubygems.rb:396 from /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/environment.rb:48 from ./test/unit/../test_helper.rb:5 from ./test/unit/project_test.rb:1 from /usr/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/rake_test_loader.rb:5 from /usr/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/rake_test_loader.rb:5:in `each'' from /usr/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/rake_test_loader.rb:5 *end error output* Version info: rails (0.13.1) salted_login_generator (1.1.1) localization_generator (1.0.8) Any help appreciated. thanks. -- James Hughes Web application developer Centre for Health Services and Policy Research Vancouver, BC
Anatol Pomozov
2005-Oct-17 19:29 UTC
Re: salted login generator: rake aborts in test/time.rb
Add following line somewhere on the top of the test class require File.dirname(__FILE__) + ''/../mocks/test/time'' On 10/17/05, James Hughes <hughes.james-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello, > > I''m trying to use the salted login generator and having several > problems. The first is that, when I run the tests with rake, I get the > error pasted below. > > > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:5: > undefined method `cattr_accessor'' for Time:Class (NoMethodError) > > I have tried putting "require ''active_support''" (I think that''s where > cattr_accessor lives) at the top of test/time.rb but that results in > the following: > > > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:3:in > `require'': no such file to load -- active_support (LoadError) > > Shouldn''t all the rails libs be loaded and ready for use by the tests? > I''m still fairly new to ruby and how the require mechanism works. > > For completeness, here''s the complete stack trace accompanying the > first error message above: > > > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:7: > undefined method `cattr_accessor'' for Time:Class (NoMethodError) > from > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:5:in > `class_eval'' > from > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:5 > from /usr/local/lib/site_ruby/1.8/rubygems/specification.rb:1 > from /usr/local/lib/site_ruby/1.8/rubygems.rb:396 > from > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/environment.rb:48 > from ./test/unit/../test_helper.rb:5 > from ./test/unit/project_test.rb:1 > from /usr/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/rake_test_loader.rb:5 > from /usr/lib/ruby/gems/1.8/gems/rake-0.6.2 > /lib/rake/rake_test_loader.rb:5:in > `each'' > from /usr/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/rake_test_loader.rb:5 > *end error output* > > Version info: > rails (0.13.1) > salted_login_generator (1.1.1) > localization_generator (1.0.8) > > > Any help appreciated. > thanks. > > -- > James Hughes > Web application developer > Centre for Health Services and Policy Research > Vancouver, BC > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- anatol _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
James Hughes
2005-Oct-17 20:45 UTC
Re: salted login generator: rake aborts in test/time.rb
On 10/17/05, Anatol Pomozov <anatol.pomozov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Add following line somewhere on the top of the test class > > require File.dirname(__FILE__) + ''/../mocks/test/time''Why? For the record, I did try this at the top of test_helper.rb with no change in the result. A closer look at the stack trace indicates that things go off the rails (sorry) at the require for environment.rb in test_helper.rb and never come back. jh> > > > On 10/17/05, James Hughes <hughes.james-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hello, > > > > I''m trying to use the salted login generator and having several > > problems. The first is that, when I run the tests with rake, I get the > > error pasted below. > > > > > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:5: > > undefined method `cattr_accessor'' for Time:Class (NoMethodError) > > > > I have tried putting "require ''active_support''" (I think that''s where > > cattr_accessor lives) at the top of test/time.rb but that results in > > the following: > > > > > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:3:in > > `require'': no such file to load -- active_support (LoadError) > > > > Shouldn''t all the rails libs be loaded and ready for use by the tests? > > I''m still fairly new to ruby and how the require mechanism works. > > > > For completeness, here''s the complete stack trace accompanying the > > first error message above: > > > > > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:7: > > undefined method `cattr_accessor'' for Time:Class (NoMethodError) > > from > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:5:in > > `class_eval'' > > from > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:5 > > from > /usr/local/lib/site_ruby/1.8/rubygems/specification.rb:1 > > from /usr/local/lib/site_ruby/1.8/rubygems.rb:396 > > from > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/environment.rb:48 > > from ./test/unit/../test_helper.rb:5 > > from ./test/unit/project_test.rb:1 > > from > /usr/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/rake_test_loader.rb:5 > > from /usr/lib/ruby/gems/1.8/gems/rake- > 0.6.2/lib/rake/rake_test_loader.rb:5:in > > `each'' > > from > /usr/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/rake_test_loader.rb:5 > > *end error output* > > > > Version info: > > rails (0.13.1) > > salted_login_generator ( 1.1.1) > > localization_generator (1.0.8) > > > > > > Any help appreciated. > > thanks. > > > > -- > > James Hughes > > Web application developer > > Centre for Health Services and Policy Research > > Vancouver, BC > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > -- > anatol > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- James Hughes Web application developer Centre for Health Services and Policy Research Vancouver, BC
Bruno Celeste
2005-Oct-17 20:59 UTC
Re: salted login generator: rake aborts in test/time.rb
The answer is in this wiki page ;) http://wiki.rubyonrails.com/rails/pages/SaltedHashLoginGenerator PS: sorry for double posting, I posted in the wrong topic :( 2005/10/17, James Hughes <hughes.james-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> On 10/17/05, Anatol Pomozov <anatol.pomozov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Add following line somewhere on the top of the test class > > > > require File.dirname(__FILE__) + ''/../mocks/test/time'' > > Why? > > For the record, I did try this at the top of test_helper.rb with no > change in the result. > A closer look at the stack trace indicates that things go off the > rails (sorry) at the require for environment.rb in test_helper.rb and > never come back. > > jh > > > > > > > > > On 10/17/05, James Hughes <hughes.james-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > Hello, > > > > > > I''m trying to use the salted login generator and having several > > > problems. The first is that, when I run the tests with rake, I get the > > > error pasted below. > > > > > > > > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:5: > > > undefined method `cattr_accessor'' for Time:Class (NoMethodError) > > > > > > I have tried putting "require ''active_support''" (I think that''s where > > > cattr_accessor lives) at the top of test/time.rb but that results in > > > the following: > > > > > > > > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:3:in > > > `require'': no such file to load -- active_support (LoadError) > > > > > > Shouldn''t all the rails libs be loaded and ready for use by the tests? > > > I''m still fairly new to ruby and how the require mechanism works. > > > > > > For completeness, here''s the complete stack trace accompanying the > > > first error message above: > > > > > > > > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:7: > > > undefined method `cattr_accessor'' for Time:Class (NoMethodError) > > > from > > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:5:in > > > `class_eval'' > > > from > > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/../test/mocks/test/time.rb:5 > > > from > > /usr/local/lib/site_ruby/1.8/rubygems/specification.rb:1 > > > from /usr/local/lib/site_ruby/1.8/rubygems.rb:396 > > > from > > /home/jhughes/work/project-tracker-rails/trunk/project-tracker/config/environment.rb:48 > > > from ./test/unit/../test_helper.rb:5 > > > from ./test/unit/project_test.rb:1 > > > from > > /usr/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/rake_test_loader.rb:5 > > > from /usr/lib/ruby/gems/1.8/gems/rake- > > 0.6.2/lib/rake/rake_test_loader.rb:5:in > > > `each'' > > > from > > /usr/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/rake_test_loader.rb:5 > > > *end error output* > > > > > > Version info: > > > rails (0.13.1) > > > salted_login_generator ( 1.1.1) > > > localization_generator (1.0.8) > > > > > > > > > Any help appreciated. > > > thanks. > > > > > > -- > > > James Hughes > > > Web application developer > > > Centre for Health Services and Policy Research > > > Vancouver, BC > > > _______________________________________________ > > > Rails mailing list > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > -- > > anatol > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > -- > James Hughes > Web application developer > Centre for Health Services and Policy Research > Vancouver, BC > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
James Hughes
2005-Oct-17 21:19 UTC
Re: salted login generator: rake aborts in test/time.rb
On 10/17/05, Bruno Celeste <bruno.celeste-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> The answer is in this wiki page ;) > http://wiki.rubyonrails.com/rails/pages/SaltedHashLoginGeneratorYep, moving ''require rubygems'' above the require for environment.rb worked, thanks. Not sure how I missed that, I thought I scoured that page last week when I first encountered this problem. bye, jh -- James Hughes Web application developer Centre for Health Services and Policy Research Vancouver, BC