File: howto_spec.rb

package info (click to toggle)
ruby-innate 2013.02.21-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 848 kB
  • ctags: 622
  • sloc: ruby: 4,340; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 626 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require 'rubygems'
require 'innate'

class SpecMe
  Innate.node '/'

  def index
    "I should be at /"
  end

  def foo
    response['Content-Type'] = 'text/css'
    "I should be at /foo"
  end
end

require 'innate/spec'

describe 'An example spec' do
  behaves_like :mock

  should 'respond to /' do
    got = get('/')
    got.status.should == 200
    got.body.should == "I should be at /"
    got['Content-Type'].should == 'text/html'
  end

  should 'respond to /foo' do
    got = get('/foo')
    got.status.should == 200
    got.body.should == "I should be at /foo"
    got['Content-Type'].should == 'text/css'
  end
end