Hey all, I''m new to BDD and rspec, but I am very intrigued. I tried installing rspec and rspec_on_rails into my Rails app, but I am having some trouble. I chose to install both as plugins, as the documentation suggests. I checked out the CURRENT tag from svn, and copied the rspec and rspec_on_rails directories into my app''s vendor/plugins directory. Then I ran script/generate rspec, which created its files. Everything seemed ok, so I wrote up a little model spec, put it in spec/models, and ran rake spec. I did put require "File.dirname(__FILE__) + ''/../spec_helper.rb''" at the top of my spec file. The message and call stack I get back is: =c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:266:in `load_missing_constant'': uninitialized constant Spec::Rails (NameError) from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:452:in `const_missing'' from C:/src/Aptana/ir/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/example/configuration.rb:14 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require'' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in `new_constants_in'' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require'' from C:/src/Aptana/ir/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions.rb:5 ... 18 levels... from C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb:13:in `load_files'' from C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/options.rb:83:in `run_examples'' from C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/command_line.rb:19:in `run'' from C:/src/Aptana/ir/vendor/plugins/rspec/bin/spec:3 rake aborted! Command ruby -I"C:/src/Aptana/ir/vendor/plugins/rspec/lib" "C:/src/Aptana/ir/ven dor/plugins/rspec/bin/spec" "spec/models/image_spec.rb" --options "C:/src/Aptana /ir/config/../spec/spec.opts" failed = As you can see, I am running Windows. Does anyone have any idea what I am doing wrong? Thanks, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071219/67815598/attachment.html
On Dec 19, 2007 7:31 AM, Ben Greenberg <mailing_lists at bengreenberg.net> wrote:> > > Hey all, > > I''m new to BDD and rspec, but I am very intrigued. > > I tried installing rspec and rspec_on_rails into my Rails app, but I am > having some trouble. > > I chose to install both as plugins, as the documentation suggests. I > checked out the CURRENT tag from svn, and copied the rspec and > rspec_on_rails directories into my app''s vendor/plugins directory. Then I > ran script/generate rspec, which created its files. Everything seemed ok, so > I wrote up a little model spec, put it in spec/models, and ran rake spec. I > did put require "File.dirname(__FILE__) + ''/../spec_helper.rb''" at the top > of my spec file. > > The message and call stack I get back is: > > => > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:266:in > `load_missing_constant'': uninitialized constant Spec::Rails (NameError) > from > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:452:in > `const_missing'' > from > C:/src/Aptana/ir/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/example/configuration.rb:14 > from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > from > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in > `require'' > from > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in > `new_constants_in'' > from > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in > `require'' > from > C:/src/Aptana/ir/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions.rb:5 > ... 18 levels... > from > C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb:13:in > `load_files'' > from > C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/options.rb:83:in > `run_examples'' > from > C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/command_line.rb:19:in > `run'' > from C:/src/Aptana/ir/vendor/plugins/rspec/bin/spec:3 > rake aborted! > Command ruby -I"C:/src/Aptana/ir/vendor/plugins/rspec/lib" > "C:/src/Aptana/ir/ven > dor/plugins/rspec/bin/spec" "spec/models/image_spec.rb" --options > "C:/src/Aptana > /ir/config/../spec/spec.opts" failed > => > As you can see, I am running Windows. > > Does anyone have any idea what I am doing wrong?Are you running this from Aptana or from the command line?> > Thanks, > Ben > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky wrote:> On Dec 19, 2007 7:31 AM, Ben Greenberg <mailing_lists at bengreenberg.net> wrote: > >> Hey all, >> >> I''m new to BDD and rspec, but I am very intrigued. >> >> I tried installing rspec and rspec_on_rails into my Rails app, but I am >> having some trouble. >> >> I chose to install both as plugins, as the documentation suggests. I >> checked out the CURRENT tag from svn, and copied the rspec and >> rspec_on_rails directories into my app''s vendor/plugins directory. Then I >> ran script/generate rspec, which created its files. Everything seemed ok, so >> I wrote up a little model spec, put it in spec/models, and ran rake spec. I >> did put require "File.dirname(__FILE__) + ''/../spec_helper.rb''" at the top >> of my spec file. >> >> The message and call stack I get back is: >> >> =>> >> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:266:in >> `load_missing_constant'': uninitialized constant Spec::Rails (NameError) >> from >> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:452:in >> `const_missing'' >> from >> C:/src/Aptana/ir/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/example/configuration.rb:14 >> from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in >> `gem_original_require'' >> from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in >> `require'' >> from >> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in >> `require'' >> from >> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in >> `new_constants_in'' >> from >> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in >> `require'' >> from >> C:/src/Aptana/ir/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions.rb:5 >> ... 18 levels... >> from >> C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb:13:in >> `load_files'' >> from >> C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/options.rb:83:in >> `run_examples'' >> from >> C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/command_line.rb:19:in >> `run'' >> from C:/src/Aptana/ir/vendor/plugins/rspec/bin/spec:3 >> rake aborted! >> Command ruby -I"C:/src/Aptana/ir/vendor/plugins/rspec/lib" >> "C:/src/Aptana/ir/ven >> dor/plugins/rspec/bin/spec" "spec/models/image_spec.rb" --options >> "C:/src/Aptana >> /ir/config/../spec/spec.opts" failed >> =>> >> As you can see, I am running Windows. >> >> Does anyone have any idea what I am doing wrong? >> > > Are you running this from Aptana or from the command line? > >Thanks for the quick reply. I am running from the command line, in my RAILS_ROOT.>> Thanks, >> Ben >> >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> >> > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071219/f0685930/attachment-0001.html
On Dec 19, 2007 8:46 AM, Ben Greenberg <mailing_lists at bengreenberg.net> wrote:> > David Chelimsky wrote: > > On Dec 19, 2007 7:31 AM, Ben Greenberg <mailing_lists at bengreenberg.net> > wrote: > > > Hey all, > > I''m new to BDD and rspec, but I am very intrigued. > > I tried installing rspec and rspec_on_rails into my Rails app, but I am > having some trouble. > > I chose to install both as plugins, as the documentation suggests. I > checked out the CURRENT tag from svn, and copied the rspec and > rspec_on_rails directories into my app''s vendor/plugins directory. Then I > ran script/generate rspec, which created its files. Everything seemed ok, so > I wrote up a little model spec, put it in spec/models, and ran rake spec. I > did put require "File.dirname(__FILE__) + ''/../spec_helper.rb''" at the top > of my spec file. > > The message and call stack I get back is: > > => > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:266:in > `load_missing_constant'': uninitialized constant Spec::Rails (NameError) > from > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:452:in > `const_missing'' > from > C:/src/Aptana/ir/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/example/configuration.rb:14 > from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > from > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in > `require'' > from > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in > `new_constants_in'' > from > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in > `require'' > from > C:/src/Aptana/ir/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions.rb:5 > ... 18 levels... > from > C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb:13:in > `load_files'' > from > C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/options.rb:83:in > `run_examples'' > from > C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/command_line.rb:19:in > `run'' > from C:/src/Aptana/ir/vendor/plugins/rspec/bin/spec:3 > rake aborted! > Command ruby -I"C:/src/Aptana/ir/vendor/plugins/rspec/lib" > "C:/src/Aptana/ir/ven > dor/plugins/rspec/bin/spec" "spec/models/image_spec.rb" --options > "C:/src/Aptana > /ir/config/../spec/spec.opts" failed > => > As you can see, I am running Windows. > > Does anyone have any idea what I am doing wrong? > > Are you running this from Aptana or from the command line? > > > > Thanks for the quick reply. > > I am running from the command line, in my RAILS_ROOT.And you''ve got the following near the top of spec/spec_helper.rb? require ''spec'' require ''spec/rails''
Also, could you post the spec if possible? - Chad On Dec 19, 2007, at 10:11 AM, David Chelimsky wrote:> On Dec 19, 2007 8:46 AM, Ben Greenberg > <mailing_lists at bengreenberg.net> wrote: >> >> David Chelimsky wrote: >> >> On Dec 19, 2007 7:31 AM, Ben Greenberg <mailing_lists at bengreenberg.net >> > >> wrote: >> >> >> Hey all, >> >> I''m new to BDD and rspec, but I am very intrigued. >> >> I tried installing rspec and rspec_on_rails into my Rails app, but >> I am >> having some trouble. >> >> I chose to install both as plugins, as the documentation suggests. I >> checked out the CURRENT tag from svn, and copied the rspec and >> rspec_on_rails directories into my app''s vendor/plugins directory. >> Then I >> ran script/generate rspec, which created its files. Everything >> seemed ok, so >> I wrote up a little model spec, put it in spec/models, and ran rake >> spec. I >> did put require "File.dirname(__FILE__) + ''/../spec_helper.rb''" at >> the top >> of my spec file. >> >> The message and call stack I get back is: >> >> =>> >> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/ >> active_support/dependencies.rb:266:in >> `load_missing_constant'': uninitialized constant Spec::Rails >> (NameError) >> from >> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/ >> active_support/dependencies.rb:452:in >> `const_missing'' >> from >> C:/src/Aptana/ir/vendor/plugins/rspec_on_rails/lib/spec/rails/ >> extensions/spec/example/configuration.rb:14 >> from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in >> `gem_original_require'' >> from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in >> `require'' >> from >> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/ >> active_support/dependencies.rb:495:in >> `require'' >> from >> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/ >> active_support/dependencies.rb:342:in >> `new_constants_in'' >> from >> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/ >> active_support/dependencies.rb:495:in >> `require'' >> from >> C:/src/Aptana/ir/vendor/plugins/rspec_on_rails/lib/spec/rails/ >> extensions.rb:5 >> ... 18 levels... >> from >> C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/ >> example_group_runner.rb:13:in >> `load_files'' >> from >> C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/options.rb: >> 83:in >> `run_examples'' >> from >> C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/ >> command_line.rb:19:in >> `run'' >> from C:/src/Aptana/ir/vendor/plugins/rspec/bin/spec:3 >> rake aborted! >> Command ruby -I"C:/src/Aptana/ir/vendor/plugins/rspec/lib" >> "C:/src/Aptana/ir/ven >> dor/plugins/rspec/bin/spec" "spec/models/image_spec.rb" --options >> "C:/src/Aptana >> /ir/config/../spec/spec.opts" failed >> =>> >> As you can see, I am running Windows. >> >> Does anyone have any idea what I am doing wrong? >> >> Are you running this from Aptana or from the command line? >> >> >> >> Thanks for the quick reply. >> >> I am running from the command line, in my RAILS_ROOT. > > And you''ve got the following near the top of spec/spec_helper.rb? > > require ''spec'' > require ''spec/rails'' > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
Chad Humphries wrote:> Also, could you post the spec if possible? > > - Chad > > On Dec 19, 2007, at 10:11 AM, David Chelimsky wrote: > > >> And you''ve got the following near the top of spec/spec_helper.rb? >> >> require ''spec'' >> require ''spec/rails'' >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >>My spec/spec_helper.rb does contain those lines. I did not modify it after it was generated. The one spec I have is spec/models/image_spec.rb. The contents are: require File.dirname(__FILE__) + ''/../spec_helper.rb'' describe Image, "brand new" do before(:each) do @image = Image.new end it "should be in the review bucket" do @image.bucket.should equal(Bucket.review) end end Thanks, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071219/3f2c1e8e/attachment.html