Skip to content

Commit da2bcac

Browse files
authored
Make color_enabled consistent (#167)
Disabling color only applies to the diff, not the header and the key. Disabling color is needed for my team, because we use CircleCI which can show color sometimes, and remove it at other times (I believe based on the length of the log). And in the later case, we're seeing ansi color codes. I have confirmed the change proposed in #82 allows us to disable color in all of the output.
1 parent 991b1b6 commit da2bcac

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

lib/super_diff/rspec/monkey_patches.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def console_code_for(code_or_symbol)
7272

7373
# Patch so it does not apply a color if code_or_symbol is nil
7474
def wrap(text, code_or_symbol)
75-
if RSpec.configuration.color_enabled? && code = console_code_for(code_or_symbol)
75+
if SuperDiff.configuration.color_enabled? && code = console_code_for(code_or_symbol)
7676
"\e[#{code}m#{text}\e[0m"
7777
else
7878
text

support/test_plan.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,6 @@ def run_test_with_libraries(*libraries)
156156
option_parser.parse!
157157
end
158158

159-
RSpec.configure do |config|
160-
config.color_mode = color_enabled? ? :on : :off
161-
end
162-
163159
SuperDiff.configuration.merge!(
164160
configuration.merge(color_enabled: color_enabled?)
165161
)

0 commit comments

Comments
 (0)