Sha256: b3b1abb1d8552d2c131add3a154863ecc7b6d8edb6a05961c9f4afc2302c3e16

Contents?: true

Size: 966 Bytes

Versions: 1

Compression:

Stored size: 966 Bytes

Contents

# Procesa el resultado de las pruebas unitarias
module Liri
  class Manager
    class TestResult
      def initialize
        @example_quantity = 0
        @failure_quantity = 0
        @passed_quantity = 0
      end
      def update(test_result)
        @example_quantity += test_result['example_quantity']
        @failure_quantity += test_result['failure_quantity']
        @passed_quantity += (@example_quantity - @failure_quantity)
      end

      def print_process(test_result)
        passed_quantity = test_result['example_quantity'] - test_result['failure_quantity']
        passed_quantity.times do
          print '.'
        end

        test_result['failure_quantity'].times do
          print 'F'
        end
      end

      def print_summary
        print_examples_and_failures
      end

      private

      def print_examples_and_failures
        puts "#{@example_quantity} examples, #{@failure_quantity} failures\n\n"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
liri-0.1.0 lib/manager/test_result.rb