Rails test suite acting strange - type macthing fails
If you have dummy classes defined in your examples, and your test suite contains, for example, capybara features, which are dropping code on each run, leading to mandelbugs
The way to debug this is to add snippet similar to following to spec_helper:
module ActiveSupport::Dependencies
def clear_with_caller
puts 'CLEARING!', SomeProblematicClass.object_id, caller
clear_without_caller
end
alias_method_chain :clear, :caller
end
And then you can grep your test suite output:
rspec --seed [failing_seed] | grep CLEARING -A 20
# or
rspec --seed [failing_seed] | less # /CLEARING
Written by Titov Andrey
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#