RSpec 2.1.0 Start up problems

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) from /Users/bruparel/.rvm/gems/ruby-1.9.2-p0/gems/rspec- expectations-2.1.0/lib/rspec/expectations/backward_compatibility.rb: 6:inconst_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:inload’
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:inmap’
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:inrun’
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:inrun’
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

On Sun, Dec 5, 2010 at 9:39 PM, Bharat [email protected] wrote:

it “should be valid with a name attribute” do
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

Thanks David and apologies. I should have looked harder.
By the way, I have an extensive Shoulda test suite for my open source
Rails 3 project. Do you have any advice on how to port it to RSpec?
Here is the link in case you are interested

Currently it uses Shoulda/Webrat/Cucumber stack. I am moving it to
Rspec/Capybara/Cucumber, any thoughts?
Bharat