Class: LobsterSpec
- Inherits:
-
Rack::ClientSpec::TestCase
- Object
- Rack::ClientSpec::TestCase
- LobsterSpec
- Defined in:
- lib/lobster_spec.rb
Overview
<– test case
Instance Attribute Summary
Attributes inherited from Rack::ClientSpec::TestCase
Instance Method Summary collapse
-
#test_flip ⇒ Object
<– test method.
Methods inherited from Rack::ClientSpec::TestCase
#assert_request, #call_test_method, #initialize, make_sequences, #route, run_sequence
Methods included from Rack::ClientSpec::Assertions
Constructor Details
This class inherits a constructor from Rack::ClientSpec::TestCase
Instance Method Details
#test_flip ⇒ Object
<– 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 |