diff options
author | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2019-02-27 20:30:24 +0900 |
---|---|---|
committer | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2019-02-27 20:30:24 +0900 |
commit | e59c621c4529910b1e878f767396f4ee39802c38 (patch) | |
tree | 33a1733bf57d54785571097f9c0957fb818f6f2a | |
parent | ad9fee2cbd1d0edf029cf91824b38481fad06790 (diff) | |
download | bundler-skip-non-color-tty.tar.gz |
skip colorize examples when the environment was mswin or non tty.skip-non-color-tty
-rw-r--r-- | spec/bundler/source_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/bundler/source_spec.rb b/spec/bundler/source_spec.rb index 9ef8e7e50f..d70fd7e549 100644 --- a/spec/bundler/source_spec.rb +++ b/spec/bundler/source_spec.rb @@ -60,6 +60,10 @@ RSpec.describe Bundler::Source do before { Bundler.ui = Bundler::UI::Shell.new } it "should return a string with the spec name and version and locked spec version" do + if Bundler.ui.instance_variable_get(:@shell).is_a?(Bundler::Thor::Shell::Basic) + skip "tty color is not supported with Thor::Shell::Basic environment." + end + expect(subject.version_message(spec)).to eq("nokogiri >= 1.6\e[32m (was < 1.5)\e[0m") end end @@ -79,6 +83,10 @@ RSpec.describe Bundler::Source do before { Bundler.ui = Bundler::UI::Shell.new } it "should return a string with the locked spec version in yellow" do + if Bundler.ui.instance_variable_get(:@shell).is_a?(Bundler::Thor::Shell::Basic) + skip "tty color is not supported with Thor::Shell::Basic environment." + end + expect(subject.version_message(spec)).to eq("nokogiri 1.6.1\e[33m (was 1.7.0)\e[0m") end end @@ -92,6 +100,10 @@ RSpec.describe Bundler::Source do before { Bundler.ui = Bundler::UI::Shell.new } it "should return a string with the locked spec version in green" do + if Bundler.ui.instance_variable_get(:@shell).is_a?(Bundler::Thor::Shell::Basic) + skip "tty color is not supported with Thor::Shell::Basic environment." + end + expect(subject.version_message(spec)).to eq("nokogiri 1.7.1\e[32m (was 1.7.0)\e[0m") end end |