Module: WIP::Runner::Spec::Helpers::Matchers::ShowMatcher::CaptureHighline

Defined in:
lib/wip/runner/spec/helpers/matchers.rb

Class Method Summary collapse

Class Method Details

.capture(io, block) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/wip/runner/spec/helpers/matchers.rb', line 63

def self.capture(io, block)
  captured_stream = StringIO.new

  original_stream = io.instance_variable_get(:'@output')
  io.instance_variable_set(:'@output', captured_stream)

  block.call

  captured_stream.string
ensure
  io.instance_variable_set(:'@output', captured_stream)
end

.nameObject



59
60
61
# File 'lib/wip/runner/spec/helpers/matchers.rb', line 59

def self.name
  'highline'
end