Module: TestProf::BeforeAll::Minitest::ClassMethods

Defined in:
lib/test_prof/recipes/minitest/before_all.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#before_all_executorObject

Returns the value of attribute before_all_executor.



57
58
59
# File 'lib/test_prof/recipes/minitest/before_all.rb', line 57

def before_all_executor
  @before_all_executor
end

Instance Method Details

#before_allObject



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/test_prof/recipes/minitest/before_all.rb', line 59

def before_all
  self.before_all_executor = Executor.new(&Proc.new)

  prepend(Module.new do
    def setup
      self.class.before_all_executor.activate!(self.class)
      self.class.before_all_executor.restore_to(self)
      super
    end

    def teardown
      super
      self.class.before_all_executor.try_deactivate!
    end
  end)
end