Class: LobsterSpec

Inherits:
Rack::ClientSpec::TestCase show all
Defined in:
lib/lobster_spec.rb

Overview

<– test case

Instance Attribute Summary

Attributes inherited from Rack::ClientSpec::TestCase

#sequence

Instance Method Summary collapse

Methods inherited from Rack::ClientSpec::TestCase

#assert_request, #call_test_method, #initialize, make_sequences, #route, run_sequence

Methods included from Rack::ClientSpec::Assertions

#assert

Constructor Details

This class inherits a constructor from Rack::ClientSpec::TestCase

Instance Method Details

#test_flipObject

<– test method



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/lobster_spec.rb', line 4

def test_flip # <-- test method
  get '/' do |req, res| # <-- expect request
    assert { res.status == 200 } # <-- assertion
  end

  get '/?flip=left' do |req, res| # <-- expect request
    assert { req['HTTP_REFERER'] == 'http://localhost:9292/' } # <-- assertion
  end

  get '/?flip=right' do |req, res| # <-- expect request
    assert { req['HTTP_REFERER'] == 'http://localhost:9292/?flip=left' }
  end
end