123456789_123456789_123456789_123456789_123456789_

Module: Test::Unit::Fixture::ClassMethods

Relationships & Source Files
Defined in: lib/test/unit/fixture.rb

Instance Method Summary

Instance Method Details

#cleanup(*method_names, &callback)

[ GitHub ]

  
# File 'lib/test/unit/fixture.rb', line 212

def cleanup(*method_names, &callback)
  register_fixture(:cleanup, *method_names, &callback)
end

#fixture

[ GitHub ]

  
# File 'lib/test/unit/fixture.rb', line 200

def fixture
  @fixture ||= Fixture.new(self)
end

#register_fixture(fixture, *method_names, &callback) (private)

[ GitHub ]

  
# File 'lib/test/unit/fixture.rb', line 229

def register_fixture(fixture, *method_names, &callback)
  options = {}
  options = method_names.pop if method_names.last.is_a?(Hash)
  callbacks = method_names
  callbacks << callback if callback
  attribute(fixture, options, *callbacks)
end

#setup(*method_names, &callback)

[ GitHub ]

  
# File 'lib/test/unit/fixture.rb', line 204

def setup(*method_names, &callback)
  register_fixture(:setup, *method_names, &callback)
end

#teardown(*method_names, &callback)

[ GitHub ]

  
# File 'lib/test/unit/fixture.rb', line 220

def teardown(*method_names, &callback)
  register_fixture(:teardown, *method_names, &callback)
end

#unregister_cleanup(*method_names_or_callbacks)

[ GitHub ]

  
# File 'lib/test/unit/fixture.rb', line 216

def unregister_cleanup(*method_names_or_callbacks)
  unregister_fixture(:cleanup, *method_names_or_callbacks)
end

#unregister_fixture(fixture, *method_names_or_callbacks) (private)

[ GitHub ]

  
# File 'lib/test/unit/fixture.rb', line 237

def unregister_fixture(fixture, *method_names_or_callbacks)
  attribute(fixture, nil, *method_names_or_callbacks)
end

#unregister_setup(*method_names_or_callbacks)

[ GitHub ]

  
# File 'lib/test/unit/fixture.rb', line 208

def unregister_setup(*method_names_or_callbacks)
  unregister_fixture(:setup, *method_names_or_callbacks)
end

#unregister_teardown(*method_names_or_callbacks)

[ GitHub ]

  
# File 'lib/test/unit/fixture.rb', line 224

def unregister_teardown(*method_names_or_callbacks)
  unregister_fixture(:teardown, *method_names_or_callbacks)
end