Class: Minitest::Tagz::Tagger
- Inherits:
-
Object
- Object
- Minitest::Tagz::Tagger
- Defined in:
- lib/minitest/tagz.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.
- #patch_test_definitions ⇒ Object
- #tags_declared ⇒ Object
- #unpatch_test_definitions ⇒ Object
Constructor Details
#initialize(patchers, owner, pending_tags) ⇒ Tagger
Returns a new instance of Tagger.
109 110 111 112 113 114 |
# File 'lib/minitest/tagz.rb', line 109 def initialize(patchers, owner, ) @patchers = patchers @owner = owner @pending_tags = .map(&:to_s) super() end |
Instance Attribute Details
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
107 108 109 |
# File 'lib/minitest/tagz.rb', line 107 def owner @owner end |
#patchers ⇒ Object (readonly)
Returns the value of attribute patchers.
107 108 109 |
# File 'lib/minitest/tagz.rb', line 107 def patchers @patchers end |
#pending_tags ⇒ Object (readonly)
Returns the value of attribute pending_tags.
107 108 109 |
# File 'lib/minitest/tagz.rb', line 107 def @pending_tags end |
Instance Method Details
#handle_initial_test_definition ⇒ Object
124 125 126 127 128 129 130 |
# File 'lib/minitest/tagz.rb', line 124 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 |
#patch_test_definitions ⇒ Object
116 117 118 |
# File 'lib/minitest/tagz.rb', line 116 def patch_test_definitions @patchers.each {|p| p.patch(self)} end |
#tags_declared ⇒ Object
102 103 104 105 |
# File 'lib/minitest/tagz.rb', line 102 def patch_test_definitions @awaiting_initial_test_definition = true end |
#unpatch_test_definitions ⇒ Object
120 121 122 |
# File 'lib/minitest/tagz.rb', line 120 def unpatch_test_definitions @patchers.each(&:unpatch) end |