mirror of
https://github.com/edgecase/ruby_koans.git
synced 2026-04-15 07:23:19 -04:00
testing for win32console
This commit is contained in:
@@ -2,7 +2,12 @@
|
|||||||
# -*- ruby -*-
|
# -*- ruby -*-
|
||||||
|
|
||||||
require 'test/unit/assertions'
|
require 'test/unit/assertions'
|
||||||
require 'win32console'
|
begin
|
||||||
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user