@@ -1156,58 +1156,6 @@ def metadata_hash(*args)
1156
1156
end
1157
1157
end
1158
1158
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
-
1211
1159
it "prefers incoming cli_args" do
1212
1160
config . output_stream = StringIO . new
1213
1161
allow ( config . output_stream ) . to receive_messages :tty? => true
0 commit comments