class Test::Unit::Fixture::Fixture

Attributes

cleanup[R]
setup[R]
teardown[R]

Public Class Methods

new(test_case) click to toggle source
# File test-unit-3.3.7/lib/test/unit/fixture.rb, line 25
def initialize(test_case)
  @test_case = test_case
  @setup = HookPoint.new(@test_case, :setup, :after => :append)
  @cleanup = HookPoint.new(@test_case, :cleanup, :before => :prepend)
  @teardown = HookPoint.new(@test_case, :teardown, :before => :prepend)
  @cached_before_callbacks = {}
  @cached_after_callbacks = {}
end

Public Instance Methods

[](type) click to toggle source
# File test-unit-3.3.7/lib/test/unit/fixture.rb, line 34
def [](type)
  case type
  when :setup
    @setup
  when :cleanup
    @cleanup
  when :teardown
    @teardown
  end
end
after_callbacks(type) click to toggle source
# File test-unit-3.3.7/lib/test/unit/fixture.rb, line 49
def after_callbacks(type)
  @cached_after_callbacks[type] ||= collect_after_callbacks(type)
end
before_callbacks(type) click to toggle source
# File test-unit-3.3.7/lib/test/unit/fixture.rb, line 45
def before_callbacks(type)
  @cached_before_callbacks[type] ||= collect_before_callbacks(type)
end