Sha256: 5587c63d7acb176c332c34bda2d931ce3795fbeb1a779469ca43842d72f03433

Contents?: true

Size: 732 Bytes

Versions: 13

Compression:

Stored size: 732 Bytes

Contents

require 'test/unit'

require "openid/urinorm"
require "testutil"

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
      _newline = lines.shift

      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

13 entries across 13 versions & 3 rubygems

Version Path
pelle-ruby-openid-2.1.8 test/test_urinorm.rb
nov-ruby-openid-2.1.9 test/test_urinorm.rb
ruby-openid-2.1.8 test/test_urinorm.rb
pelle-ruby-openid-2.1.9 test/test_urinorm.rb
ruby-openid-2.1.7 test/test_urinorm.rb
ruby-openid-2.0.1 test/test_urinorm.rb
ruby-openid-2.0.2 test/test_urinorm.rb
ruby-openid-2.1.5 test/test_urinorm.rb
ruby-openid-2.0.4 test/test_urinorm.rb
ruby-openid-2.1.2 test/test_urinorm.rb
ruby-openid-2.1.4 test/test_urinorm.rb
ruby-openid-2.0.3 test/test_urinorm.rb
ruby-openid-2.1.6 test/test_urinorm.rb