# frozen_string_literal: true # Parent class for Tests # Child class constructors must define the 'roller' method to return # the dice roll class that they wish to use for the test. class BaseTest attr_reader :rolls, :timestamp, :check, :rating def initialize(character, check) @timestamp = Time.now @rolls = [roller.new] @rolls << roller.new while @rolls.last.explode? @check = check @rating = character.rating(check) end def spend_token false end def roll_total @rolls.map(&:value).reduce(&:+) end end