0

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
chourobin
  • 4,004
  • 4
  • 35
  • 48
  • How are you `require`ing `factories.rb` in your `test_helper.rb`? – Srikanth Venugopalan Mar 11 '13 at 01:15
  • I've tried putting it in the prefork block and before the prefork block. The only way it works is if I put factories.rb in the /lib directory but it is not reloaded when I modify the factories. – chourobin Mar 11 '13 at 01:56
  • I was wondering if this is how it looks - `require './factories.rb` ? In which case you might need to use [File.expand_path](http://www.ruby-doc.org/core-1.9.3/File.html#method-c-expand_path) – Srikanth Venugopalan Mar 11 '13 at 03:03

1 Answers1

0

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.

chourobin
  • 4,004
  • 4
  • 35
  • 48