Module: Fakeout

Defined in:
lib/fakeout/base.rb,
lib/fakeout/version.rb,
lib/fakeout/spec_helpers.rb,
lib/fakeout/test_helpers.rb

Defined Under Namespace

Modules: SpecHelpers, TestHelpers

Constant Summary collapse

VERSION =
"0.0.2"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.stderrObject

Returns the value of attribute stderr.



2
3
4
# File 'lib/fakeout/base.rb', line 2

def stderr
  @stderr
end

.stdoutObject

Returns the value of attribute stdout.



2
3
4
# File 'lib/fakeout/base.rb', line 2

def stdout
  @stdout
end

Class Method Details

.activate!Object



4
5
6
7
8
# File 'lib/fakeout/base.rb', line 4

def self.activate!
  $stdout    = @stdout = StringIO.new
  $stderr    = @stderr = StringIO.new
  @is_active = true
end

.deactivate!Object



10
11
12
13
14
# File 'lib/fakeout/base.rb', line 10

def self.deactivate!
  $stdout    = STDOUT
  $stderr    = STDERR
  @is_active = false
end

.is_active?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/fakeout/base.rb', line 16

def self.is_active?
  !!@is_active
end