Manually include all sub-modules and top-level types

This is needed so that `spectator/should` is not included by default.
This commit is contained in:
Michael Miller 2018-09-27 15:49:34 -06:00
parent 1c9decaa41
commit 83a2a8e238
2 changed files with 31 additions and 1 deletions

View file

@ -1,4 +1,4 @@
require "./spectator/*" require "./spectator/includes"
# Module that contains all functionality related to Spectator. # Module that contains all functionality related to Spectator.
module Spectator module Spectator

30
src/spectator/includes.cr Normal file
View file

@ -0,0 +1,30 @@
# This file includes all source files *except* `should.cr`.
# The `should.cr` file contains the optional feature for using `#should` on all objects.
# Since this is disabled by default, we don't include all files.
# Including all files with a wildcard would accidentally enable `#should` by including it's file.
# Unfortunately, that leads to the existence of this file to include everything but that file.
# First the sub-modules.
require "./internals"
require "./dsl"
require "./matchers"
require "./formatters"
# Then all of the top-level types.
require "./example"
require "./runnable_example"
require "./pending_example"
require "./example_hooks"
require "./example_group"
require "./expectation"
require "./expectation_failed"
require "./test_results"
require "./runner"
require "./result"
require "./successful_result"
require "./pending_result"
require "./failed_result"
require "./errored_result"