Module: Net::SSH::Test::Extensions::IO

Defined in:
lib/net/ssh/test/extensions.rb

Overview

An extension to the built-in ::IO class. Simply redefines IO.select so that it can be scripted in Net::SSH unit tests.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.extension_enabled?Boolean

Returns:

  • (Boolean)


130
131
132
# File 'lib/net/ssh/test/extensions.rb', line 130

def self.extension_enabled?
  @extension_enabled
end

.included(base) ⇒ Object

:nodoc:



114
115
116
# File 'lib/net/ssh/test/extensions.rb', line 114

def self.included(base) # :nodoc:
  base.extend(ClassMethods)
end

.with_test_extension(&block) ⇒ Object



120
121
122
123
124
125
126
127
128
# File 'lib/net/ssh/test/extensions.rb', line 120

def self.with_test_extension(&block)
  orig_value = @extension_enabled
  @extension_enabled = true
  begin
    yield
  ensure
    @extension_enabled = orig_value
  end
end