Class: XCKnife::EventsAnalyzer
- Inherits:
-
Object
- Object
- XCKnife::EventsAnalyzer
- Includes:
- JsonStreamParserHelper
- Defined in:
- lib/xcknife/events_analyzer.rb
Instance Attribute Summary collapse
-
#target_class_map ⇒ Object
readonly
Returns the value of attribute target_class_map.
-
#total_tests ⇒ Object
readonly
Returns the value of attribute total_tests.
Class Method Summary collapse
Instance Method Summary collapse
- #has_test_class?(target, clazz) ⇒ Boolean
- #has_test_target?(target) ⇒ Boolean
-
#initialize(events, relevant_partitions) ⇒ EventsAnalyzer
constructor
A new instance of EventsAnalyzer.
Methods included from JsonStreamParserHelper
#each_test_event, #normalize_result
Constructor Details
#initialize(events, relevant_partitions) ⇒ EventsAnalyzer
Returns a new instance of EventsAnalyzer.
14 15 16 17 18 |
# File 'lib/xcknife/events_analyzer.rb', line 14 def initialize(events, relevant_partitions) @total_tests = 0 @relevant_partitions = relevant_partitions @target_class_map = analyze_events(events) end |
Instance Attribute Details
#target_class_map ⇒ Object (readonly)
Returns the value of attribute target_class_map.
7 8 9 |
# File 'lib/xcknife/events_analyzer.rb', line 7 def target_class_map @target_class_map end |
#total_tests ⇒ Object (readonly)
Returns the value of attribute total_tests.
7 8 9 |
# File 'lib/xcknife/events_analyzer.rb', line 7 def total_tests @total_tests end |
Class Method Details
.for(events, relevant_partitions) ⇒ Object
9 10 11 12 |
# File 'lib/xcknife/events_analyzer.rb', line 9 def self.for(events, relevant_partitions) return NullEventsAnalyzer.new if events.nil? new(events, relevant_partitions) end |
Instance Method Details
#has_test_class?(target, clazz) ⇒ Boolean
24 25 26 |
# File 'lib/xcknife/events_analyzer.rb', line 24 def has_test_class?(target, clazz) has_test_target?(target) and target_class_map[target].include?(clazz) end |
#has_test_target?(target) ⇒ Boolean
20 21 22 |
# File 'lib/xcknife/events_analyzer.rb', line 20 def has_test_target?(target) target_class_map.has_key?(target) end |