edge badge

A null stream object which ignores everything until sync has been set to true. This is only used to silence unnecessary output from MiniTest, as MiniTest calls +output.sync = true+ right before it outputs the first test result.

Methods
N
S
Class Public methods
new(target_stream)

Creates a SilentUntilSyncStream object by giving it a target stream object that will be assigned to +MiniTest::Unit.output+ after sync is set to true.

# File railties/lib/rails/commands/test_runner.rb, line 130
def initialize(target_stream)
  @target_stream = target_stream
  super(File::NULL, 'w')
end
Instance Public methods
sync=(sync)

Swaps +MiniTest::Unit.output+ to another stream when sync is true.

# File railties/lib/rails/commands/test_runner.rb, line 136
def sync=(sync)
  if sync
    @target_stream.sync = true
    MiniTest::Unit.output = @target_stream
  end

  super
end