I've recently had to migrate a project from rails 4.0 to rails 4.1 and in the process I've also updated RSpec to RSpec (3.0.0).
The project previously had the following in certain feature specs being tested with Capybara:
require 'spec_helper' require 'support/integration_helpers.rb'
require 'support/admin_support/admin_user_creation_helpers.rb'include BuildDefaults
The include BuildDefaults
refers to a module spec/support/build_defaults.rb
and has various helper methods to ensure that the database has been populated correctly. For some reason this has now stopped working and gives the following error (and stack trace):
path_to/spec/features/admin_features/admin_login_out_spec.rb:4:in
<top (required)>': uninitialized constant BuildDefaults (NameError) from /Users/u_name/.rvm/gems/ruby-2.1.2@gemset_name/gems/rspec-core-3.0.2/lib/rspec/core/configuration.rb:1057:in
block in load_spec_files' from /Users/u_name/.rvm/gems/ruby-2.1.2@gemset_name/gems/rspec-core-3.0.2/lib/rspec/core/configuration.rb:1057:ineach' from /Users/u_name/.rvm/gems/ruby-2.1.2@gemset_name/gems/rspec-core-3.0.2/lib/rspec/core/configuration.rb:1057:in
load_spec_files' from /Users/u_name/.rvm/gems/ruby-2.1.2@gemset_name/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:97:insetup' from /Users/u_name/.rvm/gems/ruby-2.1.2@gemset_name/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:85:in
run' from /Users/u_name/.rvm/gems/ruby-2.1.2@gemset_name/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:70:inrun' from /Users/u_name/.rvm/gems/ruby-2.1.2@gemset_name/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:38:in
invoke' from /Users/u_name/.rvm/gems/ruby-2.1.2@gemset_name/gems/rspec-core-3.0.2/exe/rspec:4:in<top (required)>' from /Users/u_name/Documents/rails/work/c_central_4.1.1/gemset_name/bin/rspec:7:in
' from /Users/u_name/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /Users/u_name/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
require' from -e:1:in `'
Would anybody happen to know why this has happened?
I would greatly appreciate any help on the matter.
I have looked at various other SO questions with a similar title as this one but none of them seem to be relevant.
Side note 1
It is worth noting that I have removed Spork from my test environment as it was not playing nicely for some reasons but have instead configured the project to use Spring. Though I don't think that this has anything to do with the issue, I did have to completely rebuild the test environment (running rails g rspec:install
for instance) and then used Transpec to update the Rspec syntax.