Class: Minitest::Tagz::Tagger
- Inherits:
-
Object
- Object
- Minitest::Tagz::Tagger
- Defined in:
- lib/minitest/tagz/tagger.rb
Overview
Represents the individual instance of a ‘tag` call It is essentially a state machine that works with the patcher to patch and unpatch Minitest properly
Instance Attribute Summary collapse
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#patchers ⇒ Object
readonly
Returns the value of attribute patchers.
-
#pending_tags ⇒ Object
readonly
Returns the value of attribute pending_tags.
Instance Method Summary collapse
- #handle_initial_test_definition! ⇒ Object
-
#initialize(patchers, owner, pending_tags) ⇒ Tagger
constructor
A new instance of Tagger.
- #tags_declared! ⇒ Object
Constructor Details
#initialize(patchers, owner, pending_tags) ⇒ Tagger
Returns a new instance of Tagger.
9 10 11 12 13 |
# File 'lib/minitest/tagz/tagger.rb', line 9 def initialize(patchers, owner, ) @patchers = patchers @owner = owner @pending_tags = .map(&:to_s) end |
Instance Attribute Details
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
7 8 9 |
# File 'lib/minitest/tagz/tagger.rb', line 7 def owner @owner end |
#patchers ⇒ Object (readonly)
Returns the value of attribute patchers.
7 8 9 |
# File 'lib/minitest/tagz/tagger.rb', line 7 def patchers @patchers end |
#pending_tags ⇒ Object (readonly)
Returns the value of attribute pending_tags.
7 8 9 |
# File 'lib/minitest/tagz/tagger.rb', line 7 def @pending_tags end |
Instance Method Details
#handle_initial_test_definition! ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/minitest/tagz/tagger.rb', line 20 def handle_initial_test_definition! is_initial = @awaiting_initial_test_definition @awaiting_initial_test_definition = false if is_initial res = yield unpatch_test_definitions if is_initial res end |
#tags_declared! ⇒ Object
15 16 17 18 |
# File 'lib/minitest/tagz/tagger.rb', line 15 def patch_test_definitions @awaiting_initial_test_definition = true end |