Skip to content

Commit

Permalink
Disable color when using the string failure message
Browse files Browse the repository at this point in the history
  • Loading branch information
icy-arctic-fox committed Aug 1, 2024
1 parent 64a287f commit 97b3082
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/spectator/matchers/match_data.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require "colorize"
require "../core/location_range"

module Spectator::Matchers
Expand Down Expand Up @@ -31,7 +32,14 @@ module Spectator::Matchers
end

struct FailedMatchData < MatchData
getter message : String?
getter message : String do
color_enabled = Colorize.enabled?
begin
to_s
ensure
Colorize.enabled = color_enabled
end
end

@proc : (IO ->)?

Expand Down

0 comments on commit 97b3082

Please sign in to comment.