Class: FlakyTestTracker::TestInputFactory
- Inherits:
-
Object
- Object
- FlakyTestTracker::TestInputFactory
- Defined in:
- lib/flaky_test_tracker/test_input_factory.rb
Overview
Instance Method Summary collapse
-
#build(test:, source:, attributes:) ⇒ Object
Build TestInput.
- #build_test_input_number_occurrences(test:) ⇒ Object
- #build_test_input_source_location_url(source:, attributes:) ⇒ Object
Instance Method Details
#build(test:, source:, attributes:) ⇒ Object
Build FlakyTestTracker::TestInput.
14 15 16 17 18 19 20 21 22 |
# File 'lib/flaky_test_tracker/test_input_factory.rb', line 14 def build(test:, source:, attributes:) FlakyTestTracker::TestInput.new( attributes.merge( resolved_at: nil, number_occurrences: build_test_input_number_occurrences(test: test), source_location_url: build_test_input_source_location_url(source: source, attributes: attributes) ) ) end |
#build_test_input_number_occurrences(test:) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/flaky_test_tracker/test_input_factory.rb', line 24 def build_test_input_number_occurrences(test:) if test test.number_occurrences + 1 else 1 end end |
#build_test_input_source_location_url(source:, attributes:) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/flaky_test_tracker/test_input_factory.rb', line 32 def build_test_input_source_location_url(source:, attributes:) source.file_source_location_uri( file_path: attributes[:file_path], line_number: attributes[:line_number] ).to_s end |