Sha256: 43eb18c2eb17f3ace034ab2511711109f04db32d9d9574efe6e7e85a7c1a1b11

Contents?: true

Size: 732 Bytes

Versions: 4

Compression:

Stored size: 732 Bytes

Contents

require "test/unit"
require "testutil"
require "openid/urinorm"

class URINormTestCase < Test::Unit::TestCase
  include OpenID::TestDataMixin

  def test_normalize
    lines = read_data_file('urinorm.txt')

    while lines.length > 0

      case_name = lines.shift.strip
      actual = lines.shift.strip
      expected = lines.shift.strip
      lines.shift #=> newline

      if expected == 'fail'
        begin
          OpenID::URINorm.urinorm(actual)
        rescue URI::InvalidURIError
          assert true
        else
          raise 'Should have gotten URI error'
        end
      else
        normalized = OpenID::URINorm.urinorm(actual)
        assert_equal(expected, normalized, case_name)
      end
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-openid-2.6.0 test/test_urinorm.rb
ruby-openid-2.5.0 test/test_urinorm.rb
ruby-openid-2.4.0 test/test_urinorm.rb
ruby-openid-2.3.0 test/test_urinorm.rb