Sha256: e64d2cca73fab12d737c779a1bf873c78af9d5cdb2a1262443d9c438e6695022

Contents?: true

Size: 981 Bytes

Versions: 1

Compression:

Stored size: 981 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

1 entries across 1 versions & 1 rubygems

Version Path
curb-0.9.6 tests/tc_curl.rb