Take the 2008 Git User's Survey and help out! [ hide ]

ry / ebb fork watch download tarball
public
Description: web server
Homepage: http://ebb.rubyforge.org
Clone URL: git://github.com/ry/ebb.git
Search Repo:
ryah (author)
Tue Apr 08 04:40:03 -0700 2008
commit  0861921e11e6cc5211d59ad13fd3471e85270b7a
tree    4fa60ceb6ee48ad12e0851b8fabb88bc0a1f277a
parent  cbef11050d5cde7478f45abe5f5bd3f97923f933
ebb / test / basic_test.rb
100644 46 lines (38 sloc) 0.966 kb
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
36
37
38
39
40
41
42
43
44
45
46
require File.dirname(__FILE__) + '/helper'
 
module BasicTests
  def test_get_bytes
    [1,10,1000].each do |i|
      response = get("/bytes/#{i}")
      assert_equal "#{'C'*i.to_i}", response['output']
    end
  end
  
  def test_get_unknown
    response = get('/blah')
    assert_equal "Undefined url", response['output']
  end
  
  def test_small_posts
    [1,10,321,123,1000].each do |i|
      response = post("/test_post_length", 'C'*i)
      assert_equal 200, response['status']
    end
  end
  
  def test_large_post
    [50,60,100].each do |i|
      response = post("/test_post_length", 'C'*1024*i)
      assert_equal 200, response['status']
    end
  end
end
 
class BasicTest < ServerTest
  include BasicTests
end
 
class BasicTestFD < ServerTestFD
  include BasicTests
end
 
class BasicTestUnixSocket < ServerTestSocket
  include BasicTests
  
  def test_socket_file_exists
    assert File.exists?(@socketfile)
    assert File.readable?(@socketfile)
  end
end