Sha256: 793e4c44e6043f4639fa05bf5d3586bc38775c6aa55df26d2c320d1ad3c610a6

Contents?: true

Size: 1.03 KB

Versions: 7

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

module AIRefactor
  module TestRunners
    class TestRunDiffReport
      def initialize(previous_test_run_result, test_run_result)
        @current = test_run_result
        @previous = previous_test_run_result
      end

      def no_differences?
        @current.example_count == @previous.example_count && @current.failure_count == @previous.failure_count && @current.pending_count == @previous.pending_count
      end

      def diff
        report = ""
        if @current.example_count != @previous.example_count
          report += "Example count mismatch: #{@current.example_count} != #{@previous.example_count}"
        end
        if @current.failure_count != @previous.failure_count
          report += "Failure count mismatch: #{@current.failure_count} != #{@previous.failure_count}"
        end
        if @current.pending_count != @previous.pending_count
          report += "Pending count mismatch: #{@current.pending_count} != #{@previous.pending_count}"
        end
        report
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ai_refactor-0.6.0 lib/ai_refactor/test_runners/test_run_diff_report.rb
ai_refactor-0.5.4 lib/ai_refactor/test_runners/test_run_diff_report.rb
ai_refactor-0.5.3 lib/ai_refactor/test_runners/test_run_diff_report.rb
ai_refactor-0.5.2 lib/ai_refactor/test_runners/test_run_diff_report.rb
ai_refactor-0.5.1 lib/ai_refactor/test_runners/test_run_diff_report.rb
ai_refactor-0.5.0 lib/ai_refactor/test_runners/test_run_diff_report.rb
ai_refactor-0.4.0 lib/ai_refactor/test_runners/test_run_diff_report.rb