Sha256: 9dd1f739bd29284f7c54516ec1565e3c5da5ddc64e19bc1648bbb8372024b88e

Contents?: true

Size: 448 Bytes

Versions: 11

Compression:

Stored size: 448 Bytes

Contents

require 'fake_sqs/show_output'

describe FakeSQS::ShowOutput do

  after do
    $stdout = STDOUT
  end

  it "outputs the result of rack app" do
    app = double :app
    $stdout = StringIO.new
    middleware = FakeSQS::ShowOutput.new(app)
    env = {"rack.input" => ""}
    app.should_receive(:call).with(env).and_return([200, {}, ["<xml>"]])

    middleware.call(env)

    $stdout.rewind
    $stdout.read.should eq "--- {}\n\n<xml>\n"
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fake_sqs-0.1.0 spec/unit/show_output_spec.rb
fake_sqs-0.0.11 spec/unit/show_output_spec.rb
fake_sqs-0.0.10 spec/unit/show_output_spec.rb
fake_sqs-0.0.9 spec/unit/show_output_spec.rb
fake_sqs-0.0.8 spec/unit/show_output_spec.rb
fake_sqs-0.0.7 spec/unit/show_output_spec.rb
fake_sqs-0.0.6 spec/unit/show_output_spec.rb
fake_sqs-0.0.5 spec/unit/show_output_spec.rb
fake_sqs-0.0.4 spec/unit/show_output_spec.rb
fake_sqs-0.0.3 spec/unit/show_output_spec.rb
fake_sqs-0.0.2 spec/unit/show_output_spec.rb