summaryrefslogtreecommitdiff
path: root/test/unit/wkd/url_test.rb
blob: 9bf8f64ca7abb83586ab057e04cf907da238e69c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
require 'test_helper'
require 'nickserver/wkd/url'
require 'nickserver/email_address'

module Nickserver::Wkd
  class UrlTest < Minitest::Test
    # TODO: test utf8 behavior

    # https://tools.ietf.org/html/draft-koch-openpgp-webkey-service-00#section-3.1
    def test_sample_from_draft
      url = Url.new sample_email
      assert_equal sample_url, url.to_s
    end

    protected

    def sample_email
      Nickserver::EmailAddress.new 'Joe.Doe@Example.ORG'
    end

    def sample_url
      'https://example.org/.well-known/openpgpkey/' +
        'hu/example.org/iy9q119eutrkn8s1mk4r39qejnbu3n5q'
    end
  end
end