jnicklas/turnip — Issue #21: uninitialized constant Turnip::Config (NameError)
Author: Nerian
Created: 2011-12-14 15:34:20+00:00
State: open

```ruby

require 'spork'

Spork.prefork do
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'database_cleaner'
require 'turnip/capybara'

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}

#include Sorcery::TestHelpers::Rails

# Don't preload models or routes. They are reloaded by spork.
Spork.trap_class_method(Rails::Mongoid, :load_models)
Spork.trap_method(Rails::Application::RoutesReloader, :reload!)

Capybara.javascript_driver = :webkit

RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true

Turnip::Config.step_dirs = 'spec/acceptance/steps'
Turnip::StepModule.load_steps

config.mock_with :rspec

config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end

config.before(:each) do
DatabaseCleaner.start
end

config.after(:each) do
DatabaseCleaner.clean
end
end

end

Spork.each_run do
# This code will be run each time you run your specs.
$rspec_start_time = Time.now
Fabrication.clear_definitions
end
```

It gives me `uninitialized constant Turnip::Config (NameError)`and also `uninitialized constant Turnip::StepModule (NameError)`

```
Reloading Spork for RSpec
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
uninitialized constant Turnip::Config (NameError)
/Users/Nerian/Projects/shopfrog/respondify/spec/spec_helper.rb:25:in `block (2 levels) in '
/Users/Nerian/.rvm/gems/ruby-1.9.3-p0@global/gems/rspec-core-2.7.1/lib/rspec/core.rb:71:in `configure'
/Users/Nerian/Projects/shopfrog/respondify/spec/spec_helper.rb:22:in `block in '
/Users/Nerian/.rvm/gems/ruby-1.9.3-p0@respondify/gems/spork-0.9.0.rc9/lib/spork.rb:24:in `prefork'
/Users/Nerian/Projects/shopfrog/respondify/spec/spec_helper.rb:3:in `'
/Users/Nerian/.rvm/gems/ruby-1.9.3-p0@respondify/gems/spork-0.9.0.rc9/lib/spork/test_framework.rb:138:in `block (2 levels) in preload'
/Users/Nerian/.rvm/gems/ruby-1.9.3-p0@respondify/gems/spork-0.9.0.rc9/lib/spork/app_framework/rails.rb:8:in `preload'
/Users/Nerian/.rvm/gems/ruby-1.9.3-p0@respondify/gems/spork-0.9.0.rc9/lib/spork/test_framework.rb:134:in `block in preload'
/Users/Nerian/.rvm/gems/ruby-1.9.3-p0@respondify/gems/spork-0.9.0.rc9/lib/spork.rb:62:in `exec_prefork'
/Users/Nerian/.rvm/gems/ruby-1.9.3-p0@respondify/gems/spork-0.9.0.rc9/lib/spork/test_framework.rb:120:in `preload'
/Users/Nerian/.rvm/gems/ruby-1.9.3-p0@respondify/gems/spork-0.9.0.rc9/lib/spork/run_strategy/forking.rb:25:in `preload'
/Users/Nerian/.rvm/gems/ruby-1.9.3-p0@respondify/gems/spork-0.9.0.rc9/lib/spork/runner.rb:74:in `run'
/Users/Nerian/.rvm/gems/ruby-1.9.3-p0@respondify/gems/spork-0.9.0.rc9/lib/spork/runner.rb:10:in `run'
/Users/Nerian/.rvm/gems/ruby-1.9.3-p0@respondify/gems/spork-0.9.0.rc9/bin/spork:10:in `'
/Users/Nerian/.rvm/gems/ruby-1.9.3-p0@respondify/bin/spork:19:in `load'
/Users/Nerian/.rvm/gems/ruby-1.9.3-p0@respondify/bin/spork:19:in `

'
```