summaryrefslogtreecommitdiff
path: root/spec/syntax_suggest
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-03-08 20:40:06 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-03-08 22:57:06 +0900
commit611a64250a2406ee0bc864ef3d4b565036865911 (patch)
treebcb6a15c5a71975b535518f42f8ad755c6524ee1 /spec/syntax_suggest
parente1bd45624c85e8a80991bda20801f50967ac77a1 (diff)
downloadruby-611a64250a2406ee0bc864ef3d4b565036865911.tar.gz
Disable color mode of test-syntax-suggest when on dumb terminal
The compliation-mode of Emacs sets TERM to "dumb" and does not support coloring.
Diffstat (limited to 'spec/syntax_suggest')
-rw-r--r--spec/syntax_suggest/spec_helper.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/syntax_suggest/spec_helper.rb b/spec/syntax_suggest/spec_helper.rb
index 67d401888b..8691246f38 100644
--- a/spec/syntax_suggest/spec_helper.rb
+++ b/spec/syntax_suggest/spec_helper.rb
@@ -16,6 +16,12 @@ RSpec.configure do |config|
config.expect_with :rspec do |c|
c.syntax = :expect
end
+
+ if config.color_mode == :automatic
+ if color_enabled? and (ENV["TERM"] == "dumb" or ENV["NO_COLOR"]&.slice(0))
+ config.color_mode = :off
+ end
+ end
end
# Used for debugging modifications to