Sha256: b26ee7c09cc6e099b6fd03999531cccf3fbdb7cac9b0e93ca03dca93ad989f50

Contents?: true

Size: 965 Bytes

Versions: 31

Compression:

Stored size: 965 Bytes

Contents

describe Ppl::Application::Output, "#initialize" do

  it "should accept stdout" do
    stdout = Object.new
    @output = Ppl::Application::Output.new(stdout, nil)
    @output.stdout.should be stdout
  end

  it "should accept stderr" do
    stderr = Object.new
    @output = Ppl::Application::Output.new(nil, stderr)
    @output.stderr.should be stderr
  end

end

describe Ppl::Application::Output do

  before(:each) do
    @stderr = double(IO)
    @stdout = double(IO)
    @output = Ppl::Application::Output.new(@stdout, @stderr)
  end

  describe "#error" do
    it "should delegate to stderr's puts method" do
      string = "COMPUTER OVER. VIRUS = VERY YES"
      @stderr.should_receive(:puts).with(string)
      @output.error(string)
    end
  end

  describe "#line" do
    it "should delegate to stdout's puts method" do
      string = "The quick brown fox"
      @stdout.should_receive(:puts).with(string)
      @output.line(string)
    end
  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
ppl-1.17.0 spec/ppl/adapter/output_spec.rb
ppl-1.16.0 spec/ppl/adapter/output_spec.rb
ppl-1.15.1 spec/ppl/adapter/output_spec.rb
ppl-1.15.0 spec/ppl/adapter/output_spec.rb
ppl-1.14.1 spec/ppl/adapter/output_spec.rb
ppl-1.14.0 spec/ppl/adapter/output_spec.rb
ppl-1.13.0 spec/ppl/adapter/output_spec.rb
ppl-1.12.0 spec/ppl/adapter/output_spec.rb
ppl-1.11.0 spec/ppl/adapter/output_spec.rb
ppl-1.10.0 spec/ppl/adapter/output_spec.rb
ppl-1.9.0 spec/ppl/adapter/output_spec.rb
ppl-1.8.0 spec/ppl/adapter/output_spec.rb
ppl-1.7.0 spec/ppl/adapter/output_spec.rb
ppl-1.6.0 spec/ppl/adapter/output_spec.rb
ppl-1.5.3 spec/ppl/adapter/output_spec.rb
ppl-1.5.2 spec/ppl/adapter/output_spec.rb
ppl-1.5.1 spec/ppl/adapter/output_spec.rb
ppl-1.5.0 spec/ppl/adapter/output_spec.rb
ppl-1.4.1 spec/ppl/adapter/output_spec.rb
ppl-1.3.0 spec/ppl/adapter/output_spec.rb