testing for win32console

This commit is contained in:
ahmed80dz
2011-10-07 22:18:59 +02:00
parent 0032cee9a6
commit dd36e171b0

View File

@@ -2,7 +2,12 @@
# -*- ruby -*- # -*- ruby -*-
require 'test/unit/assertions' require 'test/unit/assertions'
begin
require 'win32console' require 'win32console'
@using_win32console = true
rescue LoadError
@using_win32console = false
end
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# Support code for the Ruby Koans. # Support code for the Ruby Koans.
# -------------------------------------------------------------------- # --------------------------------------------------------------------
@@ -120,7 +125,7 @@ module EdgeCase
end end
def using_win32console def using_win32console
begin begin
!! Win32::Console::ANSI @using_win32console
rescue rescue
return false return false
end end