Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/thor/shell/color.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def can_display_colors?
end

def are_colors_supported?
stdout.tty? && ![nil, "dumb"].include?(ENV["TERM"])
stdout.tty? && ENV["TERM"] != "dumb"
end

def are_colors_disabled?
Expand Down
6 changes: 0 additions & 6 deletions spec/shell/color_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,6 @@ def shell
expect(colorless).to eq("hi!")
end

it "does nothing when the TERM environment variable is not set" do
allow(ENV).to receive(:[]).with("TERM").and_return(nil)
colorless = shell.set_color "hi!", :white
expect(colorless).to eq("hi!")
end

it "does nothing when the NO_COLOR environment variable is set" do
allow(ENV).to receive(:[]).with("NO_COLOR").and_return("")
allow($stdout).to receive(:tty?).and_return(true)
Expand Down