module AggregateAssertions::AssertionAggregator

Main entry-point for the interacting with the state of aggregation.

Public Class Methods

active?() click to toggle source
# File lib/aggregate_assertions/assertion_aggregator.rb, line 10
def active?
  !store.nil? && !store.empty?
end
add_error(error) click to toggle source
# File lib/aggregate_assertions/assertion_aggregator.rb, line 14
def add_error(error)
  store.last.add_error(error)
end
close_failure_group() click to toggle source
# File lib/aggregate_assertions/assertion_aggregator.rb, line 22
def close_failure_group
  store.pop
end
open_failure_group(label = nil) click to toggle source
# File lib/aggregate_assertions/assertion_aggregator.rb, line 18
def open_failure_group(label = nil)
  initialize_store << FailureGroup.new(label: label, location: location)
end

Private Class Methods

initialize_store() click to toggle source
# File lib/aggregate_assertions/assertion_aggregator.rb, line 32
def initialize_store
  Thread.current[:__mt_aggregate] ||= []
end
location() click to toggle source
# File lib/aggregate_assertions/assertion_aggregator.rb, line 36
def location
  caller(3, 1).first.sub(/:in .*$/, "")
end
store() click to toggle source
# File lib/aggregate_assertions/assertion_aggregator.rb, line 28
def store
  Thread.current[:__mt_aggregate]
end