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

Defined in:
lib/test/unit/fixture.rb,
lib/test/unit/fixture.rb,
lib/test/unit/fixture.rb,
lib/test/unit/fixture.rb,
lib/test/unit/fixture.rb

Instance Method Summary collapse

Instance Method Details

#after_cleanup_callbacksObject



85
86
87
# File 'lib/test/unit/fixture.rb', line 85

def after_cleanup_callbacks
  collect_fixture_callbacks(:cleanup, :after)
end

#after_setup_callbacksObject



77
78
79
# File 'lib/test/unit/fixture.rb', line 77

def after_setup_callbacks
  collect_fixture_callbacks(:setup, :after)
end

#after_teardown_callbacksObject



93
94
95
# File 'lib/test/unit/fixture.rb', line 93

def after_teardown_callbacks
  collect_fixture_callbacks(:teardown, :after)
end

#before_cleanup_callbacksObject



81
82
83
# File 'lib/test/unit/fixture.rb', line 81

def before_cleanup_callbacks
  collect_fixture_callbacks(:cleanup, :before)
end

#before_setup_callbacksObject



73
74
75
# File 'lib/test/unit/fixture.rb', line 73

def before_setup_callbacks
  collect_fixture_callbacks(:setup, :before)
end

#before_teardown_callbacksObject



89
90
91
# File 'lib/test/unit/fixture.rb', line 89

def before_teardown_callbacks
  collect_fixture_callbacks(:teardown, :before)
end

#cleanup(*method_names, &callback) ⇒ Object



30
31
32
# File 'lib/test/unit/fixture.rb', line 30

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

#fixtureObject



136
137
138
# File 'lib/test/unit/fixture.rb', line 136

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

#register_cleanup_callback(method_name_or_callback, options) ⇒ Object



55
56
57
58
# File 'lib/test/unit/fixture.rb', line 55

def register_cleanup_callback(method_name_or_callback, options)
  register_fixture_callback(:cleanup, method_name_or_callback,
                            options, :before, :prepend)
end

#register_setup_callback(method_name_or_callback, options) ⇒ Object



46
47
48
49
# File 'lib/test/unit/fixture.rb', line 46

def register_setup_callback(method_name_or_callback, options)
  register_fixture_callback(:setup, method_name_or_callback,
                            options, :after, :append)
end

#register_teardown_callback(method_name_or_callback, options) ⇒ Object



64
65
66
67
# File 'lib/test/unit/fixture.rb', line 64

def register_teardown_callback(method_name_or_callback, options)
  register_fixture_callback(:teardown, method_name_or_callback,
                            options, :before, :prepend)
end

#setup(*method_names, &callback) ⇒ Object



22
23
24
# File 'lib/test/unit/fixture.rb', line 22

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

#teardown(*method_names, &callback) ⇒ Object



38
39
40
# File 'lib/test/unit/fixture.rb', line 38

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

#unregister_cleanup(*method_names_or_callbacks) ⇒ Object



34
35
36
# File 'lib/test/unit/fixture.rb', line 34

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

#unregister_cleanup_callback(method_name_or_callback) ⇒ Object



60
61
62
# File 'lib/test/unit/fixture.rb', line 60

def unregister_cleanup_callback(method_name_or_callback)
  unregister_fixture_callback(:cleanup, method_name_or_callback)
end

#unregister_setup(*method_names_or_callbacks) ⇒ Object



26
27
28
# File 'lib/test/unit/fixture.rb', line 26

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

#unregister_setup_callback(method_name_or_callback) ⇒ Object



51
52
53
# File 'lib/test/unit/fixture.rb', line 51

def unregister_setup_callback(method_name_or_callback)
  unregister_fixture_callback(:setup, method_name_or_callback)
end

#unregister_teardown(*method_names_or_callbacks) ⇒ Object



42
43
44
# File 'lib/test/unit/fixture.rb', line 42

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

#unregister_teardown_callback(method_name_or_callback) ⇒ Object



69
70
71
# File 'lib/test/unit/fixture.rb', line 69

def unregister_teardown_callback(method_name_or_callback)
  unregister_fixture_callback(:teardown, method_name_or_callback)
end