I’m having a problem where it seems like guard-sport isn’t loading models.
After starting spork and running rake I get this error:
uninitialized constant Searcher
If I disable spork then all my tests pass.
Here is the output from starting guard:
13:28:51 - INFO - Guard is using TerminalTitle to send notifications.
13:28:51 - INFO - Starting Spork for RSpec
Using RSpec
Preloading Rails environment
Loading Spork.prefork block…
Spork is ready and listening on 8989!
13:28:54 - INFO - Spork server for RSpec successfully started
13:28:54 - INFO - Guard is now watching at ‘/Users/nicolo/projects/test-driven-rails/hashtag’
[1] guard(main)>
here is spec_helper file:
require 'rubygems'
require 'spork'
#uncomment the following line to use spork with the debugger
#require 'spork/ext/ruby-debug'
Spork.prefork do
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
RSpec.configure do |config|
config.mock_with :mocha
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.use_transactional_fixtures = true
config.infer_base_class_for_anonymous_controllers = false
config.order = "random"
end
end
Spork.each_run do
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
end