Question

I really like Miniskirt and Minitest but I am having issues loading the factories.rb file on each run using spork server. It goes:

cannot load such file -- factories (LoadError)

My factories.rb file is located in the /test directory along with my test_helper.rb.

Any tips would be appreciated.

require 'rubygems'
require 'spork'

Spork.prefork do
    ...
    require 'factories'
end
Was it helpful?

Solution

It took me a little trial and error to get everything to work, but I fixed it by switching to spork-minitest and using the master branch of guard-minitest. Here's my test suite:

group :test, :development do
  gem 'capybara'
  gem 'database_cleaner'
  gem 'awesome_print'
  gem 'turn'
  gem 'guard'
  gem 'guard-spork'
  gem 'guard-minitest', github: 'guard/guard-minitest'
  gem 'guard-livereload'
  gem 'terminal-notifier-guard'
  gem 'capybara_minitest_spec'
  gem 'rb-fsevent', '~> 0.9.1'
  gem "spork-minitest", git: "https://github.com/semaperepelitsa/spork-minitest.git"
  gem 'miniskirt'
  gem 'minitest-spec-rails'
end

Thanks for the help anyway.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top