On Tuesday, July 22, 2014 1:08:08 AM UTC+2, Sjouke Fikse wrote: > > I'm trying to create an instance of a class in a spec file, but I'm > failing to do this. > > These two files exists: > > app/models/street.rb > > spec/models/street_spec.rb > > Within street_spec.rb, I'm trying to create a new instance of the street > class, but it doesn't > know what street is. That's acceptable, but when I add `require 'streets'` > and it still fails: > > $ rspec spec/models/street_spec.rb > /home/sjouke/streetmap/spec/models/street_spec.rb:2:in `require': > cannot load such file -- street (LoadError) > from /home/sjouke/streetmap/spec/models/street_spec.rb:2:in `<top > (required)>' > from > /home/sjouke/.rvm/gems/ruby-2.1.2@streetmap/gems/rspec-core-3.0.2/lib/rspec/core/configuration.rb:1057:in > > `load' > from > /home/sjouke/.rvm/gems/ruby-2.1.2@streetmap/gems/rspec-core-3.0.2/lib/rspec/core/configuration.rb:1057:in > > `block in load_spec_files' > from > /home/sjouke/.rvm/gems/ruby-2.1.2@streetmap/gems/rspec-core-3.0.2/lib/rspec/core/configuration.rb:1057:in > > `each' > from > /home/sjouke/.rvm/gems/ruby-2.1.2@streetmap/gems/rspec-core-3.0.2/lib/rspec/core/configuration.rb:1057:in > > `load_spec_files' > from > /home/sjouke/.rvm/gems/ruby-2.1.2@streetmap/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:97:in > > `setup' > from > /home/sjouke/.rvm/gems/ruby-2.1.2@streetmap/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:85:in > > `run' > from > /home/sjouke/.rvm/gems/ruby-2.1.2@streetmap/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:70:in > > `run' > from > /home/sjouke/.rvm/gems/ruby-2.1.2@streetmap/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:38:in > > `invoke' > from > /home/sjouke/.rvm/gems/ruby-2.1.2@streetmap/gems/rspec-core-3.0.2/exe/rspec:4:in > > `<top (required)>' > from /home/sjouke/.rvm/gems/ruby-2.1.2@streetmap/bin/rspec:23:in > `load' > from /home/sjouke/.rvm/gems/ruby-2.1.2@streetmap/bin/rspec:23:in > `<main>' > from > /home/sjouke/.rvm/gems/ruby-2.1.2@streetmap/bin/ruby_executable_hooks:15:in > `eval' > from > /home/sjouke/.rvm/gems/ruby-2.1.2@streetmap/bin/ruby_executable_hooks:15:in > `<main>' > > Any idea why it wouldn't be loading the file appropriately? > Also, I'm using using rspec-rails after a suggestion from somebody in IRC. >
1. Please, post your street_spec.rb file content. 2. Did you run rails generate rspec:install ? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2b5739aa-cc1d-4f25-b769-91ea5c91e074%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.