Methods

Files

Class/Module Index [+]

Quicksearch

Test::Unit::Fixture

Public Class Methods

included(base) click to toggle source
# File lib/test/unit/fixture.rb, line 5
def included(base)
  base.extend(ClassMethods)

  [:setup, :cleanup, :teardown].each do |fixture|
    observer = Proc.new do |test_case, _, _, value, method_name|
      if value.nil?
        test_case.send("unregister_#{fixture}_method", method_name)
      else
        test_case.send("register_#{fixture}_method", method_name,
                       value)
      end
    end
    base.register_attribute_observer(fixture, &observer)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.