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
on 19.12.2007 15:06
on 19.12.2007 15:45
On Dec 19, 2007 7:31 AM, Ben Greenberg <mailing_lists@bengreenberg.net> wrote: > checked out the CURRENT tag from svn, and copied the rspec and > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:266:in > from > ... 18 levels... > 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?
on 19.12.2007 15:58
David Chelimsky wrote: >> checked out the CURRENT tag from svn, and copied the rspec and >> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:266:in >> from >> ... 18 levels... >> rake aborted! >> > > 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.
on 19.12.2007 16:12
On Dec 19, 2007 8:46 AM, Ben Greenberg <mailing_lists@bengreenberg.net> wrote: > > > C:/src/Aptana/ir/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/example/configuration.rb:14 > from > `run_examples' > == > > 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'
on 19.12.2007 16:14
Also, could you post the spec if possible? - Chad
on 20.12.2007 04:30
Chad Humphries wrote: >> require 'spec/rails' >> _______________________________________________ >> rspec-users mailing list >> rspec-users@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