Sha256: 853f3475804945ba4c704b62fd25ef25c42ec6071ea1b8a7e0c7e2bff24ca807

Contents?: true

Size: 982 Bytes

Versions: 15

Compression:

Stored size: 982 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))

class TestCurl < Test::Unit::TestCase
  def test_get
    curl = Curl.get(TestServlet.url, {:foo => "bar"})
    assert_equal "GETfoo=bar", curl.body_str

    curl = Curl.options(TestServlet.url, {:foo => "bar"}) do|http|
      http.headers['Cookie'] = 'foo=1;bar=2'
    end
    assert_equal "OPTIONSfoo=bar", curl.body_str
  end

  def test_post
    curl = Curl.post(TestServlet.url, {:foo => "bar"})
    assert_equal "POST\nfoo=bar",  curl.body_str
  end

  def test_put
    curl = Curl.put(TestServlet.url, {:foo => "bar"})
    assert_equal "PUT\nfoo=bar",  curl.body_str
  end

  def test_patch
    curl = Curl.patch(TestServlet.url, {:foo => "bar"})
    assert_equal "PATCH\nfoo=bar", curl.body_str
  end

  def test_options
    curl = Curl.options(TestServlet.url, {:foo => "bar"})
    assert_equal "OPTIONSfoo=bar", curl.body_str
  end

  include TestServerMethods 

  def setup
    server_setup
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
curb-0.9.5 tests/tc_curl.rb
curb-0.9.4 tests/tc_curl.rb
curb-0.9.3 tests/tc_curl.rb
curb-0.9.2 tests/tc_curl.rb
curb-0.9.1 tests/tc_curl.rb
curb-0.9.0 tests/tc_curl.rb
curb-0.8.8 tests/tc_curl.rb
curb-0.8.7 tests/tc_curl.rb
gus-curb-0.8.7 tests/tc_curl.rb
curb-0.8.6 tests/tc_curl.rb
curb-0.8.5 tests/tc_curl.rb
curb-0.8.4 tests/tc_curl.rb
curb-0.8.3 tests/tc_curl.rb
curb-0.8.2 tests/tc_curl.rb
curb-0.8.1 tests/tc_curl.rb