Sha256: 68ef1098476455f523fb65cc3988468adac2eb614338ff2b7d1106b15e1bda34

Contents?: true

Size: 1.02 KB

Versions: 9

Compression:

Stored size: 1.02 KB

Contents

describe Rake::Funnel::Integration::SyncOutput do
  context 'stream supports sync mode' do
    before {
      allow($stdout).to receive(:sync=)
      allow($stderr).to receive(:sync=)

      expect(subject).to be
    }

    it 'should immediately flush $stdout' do
      expect($stdout).to have_received(:sync=).with(true)
    end

    it 'should immediately flush $stderr' do
      expect($stdout).to have_received(:sync=).with(true)
    end
  end

  context 'stream does not support sync mode' do
    before {
      allow($stdout).to receive(:sync=).and_raise('$stdout.sync not supported')
      allow($stderr).to receive(:sync=).and_raise('$stderr.sync not supported')

      allow(Rake).to receive(:rake_output_message)

      expect(subject).to be
    }

    it 'should log the error for $stdout' do
      expect(Rake).to have_received(:rake_output_message).with(/Failed.*\$stdout/)
    end

    it 'should log the error for $stderr' do
      expect(Rake).to have_received(:rake_output_message).with(/Failed.*\$stderr/)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rake-funnel-0.18.0 spec/rake/funnel/integration/sync_output_spec.rb
rake-funnel-0.17.0 spec/rake/funnel/integration/sync_output_spec.rb
rake-funnel-0.16.1 spec/rake/funnel/integration/sync_output_spec.rb
rake-funnel-0.16.0 spec/rake/funnel/integration/sync_output_spec.rb
rake-funnel-0.15.0.pre spec/rake/funnel/integration/sync_output_spec.rb
rake-funnel-0.14.0.pre spec/rake/funnel/integration/sync_output_spec.rb
rake-funnel-0.13.0.pre spec/rake/funnel/integration/sync_output_spec.rb
rake-funnel-0.12.0.pre spec/rake/funnel/integration/sync_output_spec.rb
rake-funnel-0.11.0.pre spec/rake/funnel/integration/sync_output_spec.rb