Fix paths and references

This commit is contained in:
Michael Miller 2021-05-08 23:46:19 -06:00
parent 7294f2da67
commit 72b2e7ebcb
No known key found for this signature in database
GPG key ID: F9A0C5C65B162436
4 changed files with 8 additions and 12 deletions

View file

@ -43,14 +43,14 @@ module Spectator
exit(1) if autorun? && !run exit(1) if autorun? && !run
end end
@@config_builder = ConfigBuilder.new @@config_builder = Config::Builder.new
@@config : Config? @@config : Config?
# Provides a means to configure how Spectator will run and report tests. # Provides a means to configure how Spectator will run and report tests.
# A `ConfigBuilder` is yielded to allow changing the configuration. # A `ConfigBuilder` is yielded to allow changing the configuration.
# NOTE: The configuration set here can be overriden # NOTE: The configuration set here can be overriden
# with a `.spectator` file and command-line arguments. # with a `.spectator` file and command-line arguments.
def configure(& : ConfigBuilder -> _) : Nil def configure(& : Config::Builder -> _) : Nil
yield @@config_builder yield @@config_builder
end end

View file

@ -1,7 +1,7 @@
require "../composite_example_filter" require "../composite_example_filter"
require "../example_filter" require "../example_filter"
require "../formatting"
require "../null_example_filter" require "../null_example_filter"
require "../reporters"
require "../run_flags" require "../run_flags"
module Spectator module Spectator
@ -53,6 +53,7 @@ module Spectator
when .one? then formatters.first when .one? then formatters.first
else Formatting::BroadcastFormatter.new(formatters) else Formatting::BroadcastFormatter.new(formatters)
end end
end
# Enables fail-fast mode. # Enables fail-fast mode.
def fail_fast def fail_fast

View file

@ -7,11 +7,8 @@
require "./abstract_expression" require "./abstract_expression"
require "./anything" require "./anything"
require "./block" require "./block"
require "./command_line_arguments_config_source"
require "./composite_example_filter" require "./composite_example_filter"
require "./config_builder"
require "./config" require "./config"
require "./config_source"
require "./context" require "./context"
require "./context_delegate" require "./context_delegate"
require "./context_method" require "./context_method"
@ -52,6 +49,5 @@ require "./result"
require "./spec" require "./spec"
require "./tags" require "./tags"
require "./test_context" require "./test_context"
require "./test_suite"
require "./value" require "./value"
require "./wrapper" require "./wrapper"

View file

@ -1,5 +1,4 @@
require "../config" require "../config"
require "../config_builder"
require "../example" require "../example"
require "../example_context_method" require "../example_context_method"
require "../example_group" require "../example_group"
@ -173,10 +172,10 @@ module Spectator
end end
# Builds the configuration to use for the spec. # Builds the configuration to use for the spec.
# A `ConfigBuilder` is yielded to the block provided to this method. # A `Config::Builder` is yielded to the block provided to this method.
# That builder will be used to create the configuration. # That builder will be used to create the configuration.
def configure(& : ConfigBuilder -> _) : Nil def configure(& : Config::Builder -> _) : Nil
builder = ConfigBuilder.new builder = Config::Builder.new
yield builder yield builder
@config = builder.build @config = builder.build
end end
@ -206,7 +205,7 @@ module Spectator
# Retrieves the configuration. # Retrieves the configuration.
# If one wasn't previously set, a default configuration is used. # If one wasn't previously set, a default configuration is used.
private def config : Config private def config : Config
@config || ConfigBuilder.default @config || Config.default
end end
end end
end end