Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 9961564

Browse files
don't need to test if ANSICON installed on windows (that's up to the user; ok if it isn't)
1 parent 0044ceb commit 9961564

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

spec/rspec/core/configuration_spec.rb

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,58 +1156,6 @@ def metadata_hash(*args)
11561156
end
11571157
end
11581158

1159-
context "on windows" do
1160-
before do
1161-
@original_host = RbConfig::CONFIG['host_os']
1162-
RbConfig::CONFIG['host_os'] = 'mingw'
1163-
allow(config).to receive(:require)
1164-
end
1165-
1166-
after do
1167-
RbConfig::CONFIG['host_os'] = @original_host
1168-
end
1169-
1170-
context "with ANSICON available" do
1171-
around(:each) { |e| with_env_vars('ANSICON' => 'ANSICON', &e) }
1172-
1173-
it "enables colors" do
1174-
config.output_stream = StringIO.new
1175-
allow(config.output_stream).to receive_messages :tty? => true
1176-
config.color = true
1177-
expect(config.color).to be_truthy
1178-
end
1179-
1180-
it "leaves output stream intact" do
1181-
config.output_stream = $stdout
1182-
allow(config).to receive(:require) do |what|
1183-
config.output_stream = 'foo' if what =~ /Win32/
1184-
end
1185-
config.color = true
1186-
expect(config.output_stream).to eq($stdout)
1187-
end
1188-
end
1189-
1190-
context "with ANSICON NOT available" do
1191-
around { |e| without_env_vars('ANSICON', &e) }
1192-
1193-
before do
1194-
allow_warning
1195-
end
1196-
1197-
it "warns to install ANSICON" do
1198-
allow(config).to receive(:require) { raise LoadError }
1199-
expect_warning_with_call_site(__FILE__, __LINE__ + 1, /You must use ANSICON/)
1200-
config.color = true
1201-
end
1202-
1203-
it "sets color to false" do
1204-
allow(config).to receive(:require) { raise LoadError }
1205-
config.color = true
1206-
expect(config.color).to be_falsey
1207-
end
1208-
end
1209-
end
1210-
12111159
it "prefers incoming cli_args" do
12121160
config.output_stream = StringIO.new
12131161
allow(config.output_stream).to receive_messages :tty? => true

0 commit comments

Comments
 (0)