Sha256: 73e0e38eb219ea3b37c18fba16a9afda8ea7ab6d6b31781b6409c9f2a1d0b7d7

Contents?: true

Size: 703 Bytes

Versions: 3

Compression:

Stored size: 703 Bytes

Contents

require 'spec_helper'
require 'reel/app'

describe Reel::App do
  let(:app) {
    Class.new do
      include Reel::App

      get example_path do
        [200, {}, "hello foo"]
      end

    end
  }

  before(:each) do
    @app = app.new(example_addr, example_port)
  end

  after(:each) do
    @app.server.terminate if @app.server.alive?
  end

  it 'responds to get requests' do
    res = Http.with_response(:object).get example_url
    res.status.should == 200
    res.headers.should == {"Connection" => "Keep-Alive", "Content-Length" => res.body.length.to_s}
    res.body.should == "hello foo"
  end

  it 'terminates the server' do
    @app.terminate
    @app.server.should_not be_alive
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reel-0.3.0 spec/reel/app_spec.rb
reel-0.3.0.pre spec/reel/app_spec.rb
reel-0.2.0 spec/reel/app_spec.rb