Sha256: 55f48444c18bd5f121b6554fa68ba232b79e26fd91fd436d73171c2b6d7cf23c

Contents?: true

Size: 681 Bytes

Versions: 4

Compression:

Stored size: 681 Bytes

Contents

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

class VerbsTest < Test::Unit::TestCase
  def setup
    @agent = WWW::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

4 entries across 4 versions & 3 rubygems

Version Path
eric-mechanize-0.9.3.20090623142847 test/test_verbs.rb
knu-mechanize-0.9.3.20090623142847 test/test_verbs.rb
tenderlove-mechanize-0.9.3.20090617085936 test/test_verbs.rb
tenderlove-mechanize-0.9.3.20090623142847 test/test_verbs.rb