Sha256: 6f484428e97072215b3dd7e322e3638459cc99a0be8d22a3f2dd2975347e73d6

Contents?: true

Size: 429 Bytes

Versions: 9

Compression:

Stored size: 429 Bytes

Contents

require_relative 'helper'

class TestMatchWithReg < Test::Unit::TestCase

  include ARProxyTest

  def test_with_parts
    @ar.add_rule %r(http://books.cc/(.*)/(.*)) do |uri, cat, page|
      "cat: #{cat}; page: #{page}"
    end
    @req.start('books.cc') do |http|
      http.request_get('/books/1') do |res|
        assert_equal 'cat: books; page: 1', res.body
        assert_equal "200", res.code
      end
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
auto_response-0.2.0 test/match_with_reg_test.rb
auto_response-0.1.8 test/match_with_reg_test.rb
auto_response-0.1.6 test/match_with_reg_test.rb
auto_response-0.1.5 test/match_with_reg_test.rb
auto_response-0.1.4 test/match_with_reg_test.rb
auto_response-0.1.3 test/match_with_reg_test.rb
auto_response-0.1.2 test/match_with_reg_test.rb
auto_response-0.1.1 test/match_with_reg_test.rb
auto_response-0.1.0 test/match_with_reg_test.rb