Sha256: a0fdc95fc2c2664d7b6b28d280b7ba988834f0e5204c99d2e31aa07a85b09b08

Contents?: true

Size: 966 Bytes

Versions: 3

Compression:

Stored size: 966 Bytes

Contents

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

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
willcannings-ebb-0.2.0 test/basic_test.rb
ebb-0.2.1 test/basic_test.rb
ebb-0.2.0 test/basic_test.rb