shard-spectator/src/spectator.cr

23 lines
443 B
Crystal
Raw Normal View History

2018-08-19 07:15:32 +00:00
require "./spectator/*"
2018-08-18 21:33:20 +00:00
# TODO: Write documentation for `Spectator`
module Spectator
VERSION = "0.1.0"
2018-08-19 07:15:32 +00:00
@@top_level_groups = [] of ExampleGroup
def self.describe(type : T.class) : Nil forall T
group = DSL.new(type.to_s)
with group yield
@@top_level_groups << group._spec_build
end
at_exit do
@@top_level_groups.each do |group|
group.examples.each do |example|
example.run
end
end
end
2018-08-18 21:33:20 +00:00
end