Sha256: 7d05da1189f892e828698e1d2638e9d94c9bd2f4e2a13a794731a10d32af7242

Contents?: true

Size: 587 Bytes

Versions: 1

Compression:

Stored size: 587 Bytes

Contents

require 'singleton'
require 'hashie/mash'

module Polytrix
  class ResultTracker
    include Singleton

    attr_reader :results

    def example_started(example)
      data_for(example)[example.description] = Hashie::Mash.new
    end

    def execution_result(example, result)
      data_for(example)[example.description][:execution_result] = result
    end

    private
    def data_for(example)
      @results ||= Hashie::Mash.new
      group_names = example.example_group.parent_groups.map{|g| g.description}
      group_names.inject(@results, :initializing_reader)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polytrix-0.0.1 lib/polytrix/core/result_tracker.rb