Method: OutputToFDMatcher#initialize

Defined in:
lib/mspec/matchers/output_to_fd.rb

#initialize(expected, to) ⇒ OutputToFDMatcher

Returns a new instance of OutputToFDMatcher.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/mspec/matchers/output_to_fd.rb', line 10

def initialize(expected, to)
  @to, @expected = to, expected

  case @to
  when STDOUT
    @to_name = "STDOUT"
  when STDERR
    @to_name = "STDERR"
  when IO
    @to_name = @to.object_id.to_s
  else
    raise ArgumentError, "#{@to.inspect} is not a supported output target"
  end
end