1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-02-23 20:11:45 +00:00
Eric Davis f70be197e0 Unpacked OpenID gem. #699
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2437 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-02-11 19:06:37 +00:00

36 lines
732 B
Ruby

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