Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (16 sloc) 499 Bytes
module ActiveSupport
module Testing
module GarbageCollection
def self.included(base)
base.teardown :scrub_leftover_instance_variables
end
private
RESERVED_INSTANCE_VARIABLES = %w(@test_passed @passed @method_name @__name__ @_result).map(&:to_sym)
def scrub_leftover_instance_variables
(instance_variables.map(&:to_sym) - RESERVED_INSTANCE_VARIABLES).each do |var|
remove_instance_variable(var)
end
end
end
end
end
Something went wrong with that request. Please try again.