jstorimer / spin

Spin speeds up your Rails testing workflow by preloading your Rails environment.
http://jstorimer.github.com/spin/
MIT License
371 stars 60 forks source link

Conflicts with minitest #71

Open kirs opened 11 years ago

kirs commented 11 years ago

My test/minitest_helper.rb:

ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)

require "minitest/autorun"
require "minitest/rails"

# Add `gem "minitest-rails-capybara"` to the test group of your Gemfile
# and uncomment the following if you want Capybara feature tests
# require "minitest/rails/capybara"

# Uncomment if you want awesome colorful output
require "minitest/pride"

class ActiveSupport::TestCase
  # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
  # fixtures :all

  # Add more helper methods to be used by all tests here...
end

The test (test/models/user_test.rb)

# encoding: utf-8
require 'minitest_helper'

describe User do
...

Spin output:

Loading ["test/models/user_test.rb"]
/Users/kir/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- minitest_helper (LoadError)

I use Rails 3.2.11 and spin 0.6

dstrelau commented 11 years ago

Try adding -Itest to your spin command to add the test directory to the load path.

kirs commented 11 years ago
be spin serve -Itest 
be spin push test/
Loading ["test"]
/Users/kir/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- /Users/kir/Projects/projectname/test/ (LoadError)

But actually, test directory exists and there are a lot of tests :) When I run rake minispec everything is ok.