[rspec-users] RSpec 2.1.0 Start up problems

David Chelimsky dchelimsky at gmail.com
Sun Dec 5 23:32:29 EST 2010


On Sun, Dec 5, 2010 at 9:39 PM, Bharat <bcruparel at yahoo.com> wrote:
> I have a simple model as shown below:
> # == Schema Information
> # Schema version: 20101101014544
> #
> # Table name: base_folders
> #
> #  id         :integer         not null, primary key
> #  name       :string(255)
> #  created_at :datetime
> #  updated_at :datetime
> #
>
> class BaseFolder < ActiveRecord::Base
>  attr_accessible :name
>  validates_presence_of :name, :message => "^You must specify a base
> folder name."
> end
>
> And the spec: spec/models/base_folder.rb which contains
>
> require 'spec_helper'
>
> describe BaseFoler do
>
>  describe "failure" do
>    it "Base folder cannot be saved without a name" do
>      base_folder = Factory.build(:base_folder, :name => '')
>      base_folder.should_not be_valid
>    end
>  end
>
>  describe "success" do
>    it "should be valid with a name attribute" do
>      course = Factory(:course)
>      base_folder = Factory(:base_folder)
>      base_folder.should be_valid
>    end
>  end
>
> end
>
> When I execute:
>
> rspec spec/models/base_folder_spec.rb, I get the following stack
> trace:
>
>
> → rspec spec/models/base_folder_spec.rb
> /Users/bruparel/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.1.0/lib/
> rspec/core/backward_compatibility.rb:20:in `const_missing':
> uninitialized constant BaseFoler (NameError)

This failure message ^^ already tells you what I'm about to tell you:

The class name is BaseFolder, but you typed BaseFoler (without a 'd').

Cheers,
David

>        from /Users/bruparel/.rvm/gems/ruby-1.9.2-p0/gems/rspec-
> expectations-2.1.0/lib/rspec/expectations/backward_compatibility.rb:
> 6:in `const_missing'
>        from /Users/bruparel/rrw/file_manager3/spec/models/
> base_folder_spec.rb:3:in `<top (required)>'
>        from /Users/bruparel/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.1.0/
> lib/rspec/core/configuration.rb:334:in `load'
>        from /Users/bruparel/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.1.0/
> lib/rspec/core/configuration.rb:334:in `block in load_spec_files'
>        from /Users/bruparel/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.1.0/
> lib/rspec/core/configuration.rb:334:in `map'
>        from /Users/bruparel/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.1.0/
> lib/rspec/core/configuration.rb:334:in `load_spec_files'
>        from /Users/bruparel/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.1.0/
> lib/rspec/core/command_line.rb:18:in `run'
>        from /Users/bruparel/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.1.0/
> lib/rspec/core/runner.rb:55:in `run_in_process'
>        from /Users/bruparel/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.1.0/
> lib/rspec/core/runner.rb:46:in `run'
>        from /Users/bruparel/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.1.0/
> lib/rspec/core/runner.rb:10:in `block in autorun'
>
> What am I missing?
>
> Bharat
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users


More information about the rspec-users mailing list