Module: Greenbar::TestSetup::TestCaseClassExtension

Defined in:
lib/greenbar/TestSetup.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#included_test_mixinsObject



98
99
100
# File 'lib/greenbar/TestSetup.rb', line 98

def included_test_mixins
  ancestors.find_all {|aModule| aModule != self && aModule < Greenbar::TestSetup}
end

#method_added(symbol) ⇒ Object



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/greenbar/TestSetup.rb', line 77

def method_added(symbol)
  case symbol
  when :setup
    unless method_defined?(:setup_without_mixins)
      alias_method :setup_without_mixins, :setup
      define_method :setup do
        send :setup_mixins
        send :setup_without_mixins
      end
    end
  when :teardown
    unless method_defined?(:teardown_without_mixins)
      alias_method :teardown_without_mixins, :teardown
      define_method :teardown do
        send :teardown_without_mixins
        send :teardown_mixins
      end
    end
  end
end