spec/jacoco_spec.rb in danger-jacoco-instacart-0.1.12.SNAPSHOT.2 vs spec/jacoco_spec.rb in danger-jacoco-instacart-0.1.12

- old
+ new

@@ -23,11 +23,10 @@ modified_files = ['src/java/com/example/CachedRepository.java'] added_files = ['src/java/io/sample/UseCase.java'] allow(@dangerfile.git).to receive(:modified_files).and_return(modified_files) allow(@dangerfile.git).to receive(:added_files).and_return(added_files) - allow(File).to receive(:open).and_call_original end it :report do path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml" @@ -40,39 +39,9 @@ 'Class coverage is below minimum. Improve to at least 0%']) expect(@dangerfile.status_report[:markdowns][0].message).to include('### JaCoCo Code Coverage 32.9% :warning:') expect(@dangerfile.status_report[:markdowns][0].message).to include('| Class | Covered | Required | Status |') expect(@dangerfile.status_report[:markdowns][0].message).to include('|:---|:---:|:---:|:---:|') expect(@dangerfile.status_report[:markdowns][0].message).to include('| `com/example/CachedRepository` | 50% | 100% | :warning: |') - end - - it 'creates supplied status file upon failure' do - path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml" - - @my_plugin.minimum_project_coverage_percentage = 100 - @my_plugin.minimum_class_coverage_percentage = 60 - @my_plugin.file_to_create_on_failure = 'kmm.txt' - - expect(File).to receive(:open).with('kmm.txt', 'w') - @my_plugin.report path_a - end - - it 'creates default status file upon failure' do - path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml" - - @my_plugin.minimum_class_coverage_percentage = 60 - - expect(File).to receive(:open).with('danger_jacoco_failure_status_file.txt', 'w') - @my_plugin.report path_a - end - - it 'does _not_ create status file upon success' do - path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml" - - @my_plugin.minimum_class_coverage_percentage = 40 - @my_plugin.file_to_create_on_failure = 'kmm.txt' - - expect(File).to_not receive(:open).with('kmm.txt', 'w') - @my_plugin.report path_a end it 'test regex class coverage' do path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"