Skip to content

Commit

Permalink
Merge a8050c8 into 6610df3
Browse files Browse the repository at this point in the history
  • Loading branch information
tpope committed Jan 27, 2020
2 parents 6610df3 + a8050c8 commit 13cc5d3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
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

0 comments on commit 13cc5d3

Please sign in to comment.