Class: AppMap::Depends::TestFileInspector::TestReport
- Defined in:
- lib/appmap/depends/test_file_inspector.rb
Instance Attribute Summary collapse
-
#added ⇒ Object
Returns the value of attribute added.
-
#changed ⇒ Object
Returns the value of attribute changed.
-
#failed ⇒ Object
Returns the value of attribute failed.
-
#metadata_files ⇒ Object
Returns the value of attribute metadata_files.
-
#removed ⇒ Object
Returns the value of attribute removed.
Instance Method Summary collapse
-
#clean_appmaps ⇒ Object
Delete AppMaps which depend on test cases that have been deleted.
- #empty? ⇒ Boolean
- #modified_files ⇒ Object
- #report ⇒ Object
- #to_s ⇒ Object
Instance Attribute Details
#added ⇒ Object
Returns the value of attribute added
8 9 10 |
# File 'lib/appmap/depends/test_file_inspector.rb', line 8 def added @added end |
#changed ⇒ Object
Returns the value of attribute changed
8 9 10 |
# File 'lib/appmap/depends/test_file_inspector.rb', line 8 def changed @changed end |
#failed ⇒ Object
Returns the value of attribute failed
8 9 10 |
# File 'lib/appmap/depends/test_file_inspector.rb', line 8 def failed @failed end |
#metadata_files ⇒ Object
Returns the value of attribute metadata_files
8 9 10 |
# File 'lib/appmap/depends/test_file_inspector.rb', line 8 def @metadata_files end |
#removed ⇒ Object
Returns the value of attribute removed
8 9 10 |
# File 'lib/appmap/depends/test_file_inspector.rb', line 8 def removed @removed end |
Instance Method Details
#clean_appmaps ⇒ Object
Delete AppMaps which depend on test cases that have been deleted.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/appmap/depends/test_file_inspector.rb', line 33 def clean_appmaps return if removed.empty? count = .each_with_object(0) do |, count| = JSON.parse(File.read()) source_location = Util.normalize_path(['source_location']) appmap_path = File.join(.split('/')[0...-1]) if source_location && removed.member?(source_location) Util.delete_appmap(appmap_path) count += 1 end end count end |
#empty? ⇒ Boolean
24 25 26 |
# File 'lib/appmap/depends/test_file_inspector.rb', line 24 def empty? [ added, removed, changed, failed ].all?(&:empty?) end |
#modified_files ⇒ Object
28 29 30 |
# File 'lib/appmap/depends/test_file_inspector.rb', line 28 def modified_files added + changed + failed end |
#report ⇒ Object
20 21 22 |
# File 'lib/appmap/depends/test_file_inspector.rb', line 20 def report warn to_s unless empty? end |
#to_s ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/appmap/depends/test_file_inspector.rb', line 11 def to_s report = [] report << "Added test files : #{added.to_a.join(' ')}" unless added.empty? report << "Removed test files : #{removed.to_a.join(' ')}" unless removed.empty? report << "Changed test files : #{changed.to_a.join(' ')}" unless changed.empty? report << "Failed test files : #{failed.to_a.join(' ')}" unless failed.empty? report.compact.join("\n") end |