2018-12-12 18:48:08 +00:00
|
|
|
module Spectator
|
|
|
|
# Provides customization and describes specifics for how Spectator will run and report tests.
|
|
|
|
class Config
|
2018-12-13 21:16:49 +00:00
|
|
|
# Used to report test progress and results.
|
2019-03-01 02:14:03 +00:00
|
|
|
getter formatter : Formatting::Formatter
|
2018-12-13 21:16:49 +00:00
|
|
|
|
2019-03-22 05:40:00 +00:00
|
|
|
# Indicates whether the test should abort on first failure.
|
|
|
|
getter? fail_fast : Bool
|
|
|
|
|
2019-03-22 19:21:37 +00:00
|
|
|
# Indicates whether the test should fail if there are no examples.
|
|
|
|
getter? fail_blank : Bool
|
|
|
|
|
2019-03-22 20:05:48 +00:00
|
|
|
# Indicates whether the test should be done as a dry-run.
|
|
|
|
# Examples won't run, but the output will show that they did.
|
|
|
|
getter? dry_run : Bool
|
|
|
|
|
2018-12-13 21:16:49 +00:00
|
|
|
# Creates a new configuration.
|
2019-03-22 05:03:13 +00:00
|
|
|
def initialize(builder)
|
|
|
|
@formatter = builder.formatter
|
2019-03-22 05:40:00 +00:00
|
|
|
@fail_fast = builder.fail_fast?
|
2019-03-22 19:21:37 +00:00
|
|
|
@fail_blank = builder.fail_blank?
|
2019-03-22 20:05:48 +00:00
|
|
|
@dry_run = builder.dry_run?
|
2018-12-13 21:16:49 +00:00
|
|
|
end
|
2018-12-12 18:48:08 +00:00
|
|
|
end
|
|
|
|
end
|