Sha256: 223cbccb57ab174cd3d7021434a4d1389120c2ed5aae4e2f42945d68d9695ec6

Contents?: true

Size: 454 Bytes

Versions: 24

Compression:

Stored size: 454 Bytes

Contents

module StartingBlocks
  class ResultParser
    def parse(text)
      {
        tests: get_count_of('tests', text),
        assertions: get_count_of('assertions', text),
        failures: get_count_of('failures', text),
        errors: get_count_of('errors', text),
        skips: get_count_of('skips', text)
      }
    end

    def get_count_of name, text
      text.scan(/(\d+ #{name})/)[-1][0].split(' ')[0].to_i
    rescue
      0
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
starting_blocks-0.0.32 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.31 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.30 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.29 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.28 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.27 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.26 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.25 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.24 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.23 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.22 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.21 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.20 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.19 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.18 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.17 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.16 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.15 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.14 lib/starting_blocks/result_parser.rb
starting_blocks-0.0.13 lib/starting_blocks/result_parser.rb