Skip to content

Commit

Permalink
Print seed info at start and end of spec output (#12755)
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota authored Nov 23, 2022
1 parent dee1c5a commit 524fb88
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/spec/context.cr
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ module Spec
end

def run
print_order_message

internal_run
end

Expand Down Expand Up @@ -255,10 +257,6 @@ module Spec
puts Spec.color("#{total} examples, #{failures.size} failures, #{errors.size} errors, #{pendings.size} pending", final_status)
puts Spec.color("Only running `focus: true`", :focus) if Spec.focus?

if randomizer_seed = Spec.randomizer_seed
puts Spec.color("Randomized with seed: #{randomizer_seed}", :order)
end

unless failures_and_errors.empty?
puts
puts "Failed examples:"
Expand All @@ -268,6 +266,14 @@ module Spec
puts Spec.color(" # #{fail.description}", :comment)
end
end

print_order_message
end

def print_order_message
if randomizer_seed = Spec.randomizer_seed
puts Spec.color("Randomized with seed: #{randomizer_seed}", :order)
end
end

def describe(description, file, line, end_line, focus, tags, &block)
Expand Down

0 comments on commit 524fb88

Please sign in to comment.