git://git.eng.unimelb.edu.au
/
ruby_koans.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0032cee
)
testing for win32console
author
ahmed80dz
<ounis.ahmed@gmail.com>
Fri, 7 Oct 2011 20:18:59 +0000
(22:18 +0200)
committer
ahmed80dz
<ounis.ahmed@gmail.com>
Fri, 7 Oct 2011 20:18:59 +0000
(22:18 +0200)
koans/edgecase.rb
patch
|
blob
|
history
diff --git
a/koans/edgecase.rb
b/koans/edgecase.rb
index
82159ba
..
8a0c988
100644
(file)
--- a/
koans/edgecase.rb
+++ b/
koans/edgecase.rb
@@
-2,7
+2,12
@@
# -*- ruby -*-
require 'test/unit/assertions'
# -*- ruby -*-
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
def using_win32console
begin
end
def using_win32console
begin
- !! Win32::Console::ANSI
+ @using_win32console
rescue
return false
end
rescue
return false
end