public
Last active

  • Download Gist
areadme.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Do you have a problem making use of a Rails' default migration generation
logic's inclusion of your test_helper?
 
require 'test_helper'
 
Do you have to replace it with?
 
require File.dirname(__FILE__) + '/../test_helper'
 
Manually? Every time? Annoyed?
 
Your problem might be using aliases in your test_helper. It seems test_helper
is loaded twice, and these aliases get into a circular loop. See a workaround
below.
test_helper_snippet.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13
class Test::Unit::TestCase
def run_with_some_added_features(*args, &block)
# added feature code
run_without_some_added_features(*args, &block)
end
 
unless defined?(TestHelperWasLoadedOnceAlready)
alias_method_chain :run, :some_added_features
end
end
 
class TestHelperWasLoadedOnceAlready
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.