Sha256: 57047b49c315da5791b1784decbba79b9a0b6ef4dff9e020576bc8d6cbc11ba4

Contents?: true

Size: 724 Bytes

Versions: 173

Compression:

Stored size: 724 Bytes

Contents

require 'spec_helper'

module OutputTest
  include Softcover::Output
  extend self

  def puts_hello
    puts 'hello'
  end

  def print_hello
    print 'hello'
  end

  def printf_hello
    print 'hello'
  end

  def system_cmd
    system "echo hello"
  end
end

describe Softcover::Output do
  before { Softcover::Output.unsilence! }

  it 'redirects output' do
    Softcover::Output.stream = $stderr
    $stderr.should_receive(:puts).with('hello')
    $stderr.should_receive(:print).twice.with('hello')

    OutputTest.puts_hello
    OutputTest.print_hello
    OutputTest.printf_hello
  end

  it 'redirects system command output' do
    Softcover::Output.stream.should_receive(:puts)
    OutputTest.system_cmd
  end
end

Version data entries

173 entries across 173 versions & 2 rubygems

Version Path
softcover-1.0.beta16 spec/output_spec.rb
softcover-1.0.beta15 spec/output_spec.rb
softcover-1.0.beta14 spec/output_spec.rb
softcover-1.0.beta13 spec/output_spec.rb
softcover-1.0.beta12 spec/output_spec.rb
softcover-1.0.beta11 spec/output_spec.rb
softcover-1.0.beta10 spec/output_spec.rb
softcover-1.0.beta9 spec/output_spec.rb
softcover-1.0.beta8 spec/output_spec.rb
softcover-1.0.beta7 spec/output_spec.rb
softcover-1.0.beta6 spec/output_spec.rb
softcover-1.0.beta5 spec/output_spec.rb
softcover-1.0.beta4 spec/output_spec.rb
softcover-1.0.beta3 spec/output_spec.rb
softcover-nonstop-1.0.beta2 spec/output_spec.rb
softcover-1.0.beta2 spec/output_spec.rb
softcover-1.0.beta1 spec/output_spec.rb
softcover-0.9.23 spec/output_spec.rb
softcover-0.9.22 spec/output_spec.rb
softcover-0.9.21 spec/output_spec.rb