Class: Test::Unit::Fixture::Fixture
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/test/unit/fixture.rb |
Class Method Summary
- .new(test_case) ⇒ Fixture constructor
Instance Attribute Summary
Instance Method Summary
Constructor Details
.new(test_case) ⇒ Fixture
Instance Attribute Details
#cleanup (readonly)
[ GitHub ]# File 'lib/test/unit/fixture.rb', line 23
attr_reader :cleanup
#setup (readonly)
[ GitHub ]# File 'lib/test/unit/fixture.rb', line 22
attr_reader :setup
#teardown (readonly)
[ GitHub ]# File 'lib/test/unit/fixture.rb', line 24
attr_reader :teardown
Instance Method Details
#[](type)
[ GitHub ]#after_callbacks(type)
[ GitHub ]# File 'lib/test/unit/fixture.rb', line 54
def after_callbacks(type) prepend_callbacks = [] append_callbacks = [] target_test_cases.each do |ancestor| prepend_callbacks << ancestor.fixture[type].after_prepend_callbacks append_callbacks << ancestor.fixture[type].after_append_callbacks end merge_callbacks(prepend_callbacks, append_callbacks) end
#before_callbacks(type)
[ GitHub ]# File 'lib/test/unit/fixture.rb', line 43
def before_callbacks(type) prepend_callbacks = [] append_callbacks = [] target_test_cases.each do |ancestor| prepend_callbacks << ancestor.fixture[type].before_prepend_callbacks append_callbacks << ancestor.fixture[type].before_append_callbacks end merge_callbacks(prepend_callbacks, append_callbacks) end
#collect_target_test_cases (private)
[ GitHub ]#merge_callbacks(prepend_callbacks, append_callbacks) (private)
[ GitHub ]# File 'lib/test/unit/fixture.rb', line 79
def merge_callbacks(prepend_callbacks, append_callbacks) all_callbacks = [] prepend_callbacks.reverse_each do |callbacks| all_callbacks.concat(callbacks) end append_callbacks.each do |callbacks| all_callbacks.concat(callbacks) end all_callbacks end
#target_test_cases (private)
[ GitHub ]# File 'lib/test/unit/fixture.rb', line 66
def target_test_cases @cached_target_test_cases ||= collect_target_test_cases end