Daniel Mantilla
2007-Oct-05 20:53 UTC
[rspec-users] I can''t make RSpec 1.0.8 run in Rails 1.2.3
I followed the directions on the site: ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/REL_1_0_8/rspec_on_rails ruby script/generate rspec And apparently everything was ok. But when I do a "rake spec" on the app folder none of the Rails models are visible. Here is the error: (in C:/Projects/Rails/Workspace/MPS) ./spec/report_class_spec.rb:4: uninitialized constant ReportClass (NameError) I just have this on report_class_spec.rb: describe ReportClass, ''#new'' do end ReportClass was already created on app/models. When I add the following line at the top of the file it complains about ActiveRecord (uninitialized constant) require File.dirname(__FILE__) + ''/../app/models/report_class'' Thanks in advance, Daniel Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the All-new Yahoo! Mail at http://mrd.mail.yahoo.com/try_beta?.intl=ca -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071005/d5b3ddb2/attachment.html
Cody P. Skidmore
2007-Oct-05 21:24 UTC
[rspec-users] I can''t make RSpec 1.0.8 run in Rails 1.2.3
I recently installed RSpec into a new project and didn''t approach the install the same way. I''m using the same version of Rails and did the following:>gem install rspec >ruby script/plugin installsvn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails>ruby script/generate rspecAfter that it worked just fine. I wouldn''t specify the actual version unless you need an earlier release for some reason. With Regards, // Signed // Cody P. Skidmore
David Chelimsky
2007-Oct-05 21:24 UTC
[rspec-users] I can''t make RSpec 1.0.8 run in Rails 1.2.3
On 10/5/07, Daniel Mantilla <dmantilla at yahoo.com> wrote:> > I followed the directions on the site: > > ruby script/plugin install > svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec > ruby script/plugin install > svn://rubyforge.org/var/svn/rspec/tags/REL_1_0_8/rspec_on_rails > ruby script/generate rspecFirst - the directions on the site should guide you to use either CURRENT for both or REL_1_0_8 for both.> > And apparently everything was ok. But when I do a "rake spec" on the app > folder none of the Rails models are visible. Here is the error:What do you mean "rake spec on the app folder"? You should be in the project root. Are you?> > (in C:/Projects/Rails/Workspace/MPS) > ./spec/report_class_spec.rb:4: uninitialized constant ReportClass > (NameError)Well - not sure why your''e geting a name error, but a model spec should be in spec/models: spec/models/report_class_spec.rb HTH, David> > I just have this on report_class_spec.rb: > > describe ReportClass, ''#new'' do > end > > ReportClass was already created on app/models. When I add the following line > at the top of the file it complains about ActiveRecord (uninitialized > constant) > > require File.dirname(__FILE__) + ''/../app/models/report_class'' > > Thanks in advance, > > Daniel > > ________________________________ > All new Yahoo! Mail - ________________________________ > Get a sneak peak at messages with a handy reading pane. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2007-Oct-05 21:39 UTC
[rspec-users] I can''t make RSpec 1.0.8 run in Rails 1.2.3
On 10/5/07, Cody P. Skidmore <cody at skidmore.us> wrote:> I recently installed RSpec into a new project and didn''t approach the > install the same way. I''m using the same version of Rails and did the > following: > > >gem install rspec > >ruby script/plugin install > svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails > >ruby script/generate rspec > > After that it worked just fine. > > I wouldn''t specify the actual version unless you need an earlier release > for some reason.Actually - that goes against our recommendation. Relying on gems that may or may not be aligned across versions or machines leads to unexpected and unhappy results. We strongly recommend you install both plugins of the same version in each app. Cheers, David> > With Regards, > > // Signed // > > Cody P. Skidmore > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Daniel Mantilla
2007-Oct-09 15:53 UTC
[rspec-users] I can''t make RSpec 1.0.8 run in Rails 1.2.3
I followed the directions on the site: ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/REL_1_0_8/rspec_on_rails ruby script/generate rspec And apparently everything was ok. But when I do a "rake spec" on the application folder none of the Rails models are visible to RSpec. Here is the error: (in C:/Projects/Rails/Workspace/MPS) ./spec/report_class_spec.rb:4: uninitialized constant ReportClass (NameError) I just have this on report_class_spec.rb: describe ReportClass, ''#new'' do end ReportClass was already created on app/models. When I add the following line at the top of the file it complains about ActiveRecord (uninitialized constant) require File.dirname(__FILE__) + ''/../app/models/report_class'' Thanks in advance, Daniel -- Posted via http://www.ruby-forum.com/.
Daniel Mantilla
2007-Oct-09 15:56 UTC
[rspec-users] I can''t make RSpec 1.0.8 run in Rails 1.2.3
Please disregard this. This topic already exist on this forum, I thought my post didn''t go through. Daniel -- Posted via http://www.ruby-forum.com/.
Daniel Mantilla
2007-Oct-09 16:15 UTC
[rspec-users] I can''t make RSpec 1.0.8 run in Rails 1.2.3
I removed both plugins and reinstalled them using the CURRENT tag. Then ran the ''ruby script/generate rspec'' and finally the ''rake spec'', but I get the same error. Here is the full trace: C:\Projects\Rails\Workspace\MPS>rake spec --trace C:0:Warning: require_gem is obsolete. Use gem instead. (in C:/Projects/Rails/Workspace/MPS) ** Invoke spec (first_time) ** Invoke db:test:prepare (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:test:prepare ** Invoke db:test:clone (first_time) ** Invoke db:schema:dump (first_time) ** Invoke environment ** Execute db:schema:dump ** Invoke db:test:purge (first_time) ** Invoke environment ** Execute db:test:purge ** Execute db:test:clone ** Invoke db:schema:load (first_time) ** Invoke environment ** Execute db:schema:load ** Execute spec ./spec/models/report_class_spec.rb:4: uninitialized constant ReportClass (NameError) from C:/Projects/Rails/Workspace/MPS/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.r b:106:in `load'' from C:/Projects/Rails/Workspace/MPS/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.r b:106:in `load_specs'' from C:/Projects/Rails/Workspace/MPS/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.r b:105:in `each'' from C:/Projects/Rails/Workspace/MPS/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.r b:105:in `load_specs'' from C:/Projects/Rails/Workspace/MPS/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.r b:49:in `prepare!'' from C:/Projects/Rails/Workspace/MPS/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.r b:19:in `run'' from C:/Projects/Rails/Workspace/MPS/vendor/plugins/rspec/lib/spec/runner/command_line.rb:17 :in `run'' from C:/Projects/Rails/Workspace/MPS/vendor/plugins/rspec/lib/spec/runner/option_parser.rb:1 81:in `parse_options_file'' ... 7 levels... from C:/Projects/Rails/Workspace/MPS/vendor/plugins/rspec/lib/spec/runner/option_parser.rb:1 55:in `parse'' from C:/Projects/Rails/Workspace/MPS/vendor/plugins/rspec/lib/spec/runner/option_parser.rb:8 8:in `create_behaviour_runner'' from C:/Projects/Rails/Workspace/MPS/vendor/plugins/rspec/lib/spec/runner/command_line.rb:14 :in `run'' from C:/Projects/Rails/Workspace/MPS/vendor/plugins/rspec/bin/spec:3 rake aborted! Command ruby -I"C:/Projects/Rails/Workspace/MPS/vendor/plugins/rspec/lib" "C:/Projects/Rails/Workspace/MPS/vendor/plugins/rspec/bin/spec" "spec/models/report_class_spec.rb" --options "C:/Projects/Rails/Workspace/MPS/config/../spec/spec.opts" failed -- Posted via http://www.ruby-forum.com/.
Daniel Mantilla
2007-Oct-10 14:04 UTC
[rspec-users] I can''t make RSpec 1.0.8 run in Rails 1.2.3
This will sound silly but adding require File.dirname(__FILE__) + ''/../spec_helper'' at the very top of my tests fixed the problem. Thanks for your help. Daniel -- Posted via http://www.ruby-forum.com/.
David Chelimsky
2007-Oct-10 14:11 UTC
[rspec-users] I can''t make RSpec 1.0.8 run in Rails 1.2.3
On 10/10/07, Daniel Mantilla <lists at ruby-forum.com> wrote:> This will sound silly but adding > > require File.dirname(__FILE__) + ''/../spec_helper'' > > at the very top of my tests fixed the problem. Thanks for your help.Sorry man - should have seen that from the first post. Though you might consider pastie next time around - makes things easier to see separate from the email. http://pastie.caboo.se/ Cheers, David> > Daniel > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >