Module: Greenbar::TestSetup

Included in:
ClassMethodSetup, DateSetup, EnvSetup, RailsSetup, RandSetup, TimeSetup
Defined in:
lib/greenbar/TestSetup.rb

Overview

:include: doc/examples/TestSetup.rb

Defined Under Namespace

Modules: SetupModuleExtension, TestCaseClassExtension

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(fixtureModule) ⇒ Object

:nodoc:



58
59
60
# File 'lib/greenbar/TestSetup.rb', line 58

def self.included(fixtureModule) #:nodoc:
  fixtureModule.extend SetupModuleExtension
end

Instance Method Details

#setupObject

:nodoc:



42
43
44
# File 'lib/greenbar/TestSetup.rb', line 42

def setup #:nodoc:
  setup_mixins
end

#setup_mixinsObject

:nodoc:



50
51
52
# File 'lib/greenbar/TestSetup.rb', line 50

def setup_mixins #:nodoc:
  self.class.included_test_mixins.reverse_each {|testSetup| testSetup.call_instance_method :setup_mixin,  self}
end

#teardownObject

:nodoc:



46
47
48
# File 'lib/greenbar/TestSetup.rb', line 46

def teardown #:nodoc:
  teardown_mixins
end

#teardown_mixinsObject

:nodoc:



54
55
56
# File 'lib/greenbar/TestSetup.rb', line 54

def teardown_mixins #:nodoc:
  self.class.included_test_mixins.each {|testSetup| testSetup.call_instance_method :teardown_mixin, self}
end