Sha256: 5e51e46f1d763e8f973334e9064eb0fc94f5eec08ad74bc8017bab4c3da89af5

Contents?: true

Size: 676 Bytes

Versions: 2

Compression:

Stored size: 676 Bytes

Contents

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

class VerbsTest < Test::Unit::TestCase
  def setup
    @agent = Mechanize.new
  end

  def test_put
    page = @agent.put('http://localhost/verb', 'foo')
    assert_equal 1, @agent.history.length
    assert_equal('method: PUT', page.body)
  end

  def test_delete
    page = @agent.delete('http://localhost/verb', { 'q' => 'foo' })
    assert_equal 1, @agent.history.length
    assert_equal('method: DELETE', page.body)
  end

  def test_head
    page = @agent.head('http://localhost/verb', { 'q' => 'foo' })
    assert_equal 0, @agent.history.length
    assert_equal('method: HEAD', page.body)
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
kitamomonga-mechanize-0.9.3.20090724215219 test/test_verbs.rb
tenderlove-mechanize-0.9.3.20090911221705 test/test_verbs.rb