Module: DeprecationTracker::MinitestExtension

Defined in:
lib/deprecation_tracker.rb

Class Method Summary collapse

Class Method Details

.new(deprecation_tracker) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/deprecation_tracker.rb', line 42

def self.new(deprecation_tracker)
  @@deprecation_tracker = deprecation_tracker

  Module.new do
    def before_setup
      test_file_name = method(name).source_location.first.to_s
      @@deprecation_tracker.bucket = test_file_name.gsub(Rails.root.to_s, ".")
      super
    end

    def after_teardown
      super
      @@deprecation_tracker.bucket = nil
    end
  end
end