Skip to content

Commit 0a04ffd

Browse files
committed
Handle config block before setting config options.
1 parent 166b6a0 commit 0a04ffd

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

lib/rubytest/runner.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ class Runner
2323
# Exceptions that are not caught by test runner.
2424
OPEN_ERRORS = [NoMemoryError, SignalException, Interrupt, SystemExit]
2525

26+
class << self
27+
attr_accessor :assertionless
28+
end
29+
2630
# / / / A T T R I B U T E S / / /
2731

2832
# Test suite to run. This is a list of compliant test units and test cases.
@@ -107,12 +111,14 @@ def upon(type, &block)
107111

108112
# New Runner.
109113
#
110-
# @param [Array] suite
111-
# A list of compliant tests/testcases.
114+
# @param [Config] config
115+
# Config instance.
112116
#
113117
def initialize(config=nil, &block)
114118
@config = config || Test.configuration
115119

120+
block.call(@config) if block
121+
116122
@suite = @config.suite
117123
@files = @config.files
118124
@format = @config.format
@@ -124,8 +130,6 @@ def initialize(config=nil, &block)
124130
@autopath = @config.autopath
125131

126132
@advice = Advice.new
127-
128-
block.call(self) if block
129133
end
130134

131135
# The reporter to use for ouput.

0 commit comments

Comments
 (0)