diff options
author | Azul <azul@riseup.net> | 2017-09-22 15:30:40 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2017-09-22 15:30:47 +0200 |
commit | 3f777b4cbc7eaa4d127ec31e1d625bba65a40c0d (patch) | |
tree | c352dbcf7c493afad8fad1ee343734563f311301 /test/unit/wkd/url_test.rb | |
parent | bc48ac30c232f1e3fa5f5ad455f14d5fec17abeb (diff) |
wkd: implement basic lookup of keys through wkd
wkd is the web key directory. See the Readme.md in
/lib/nickserver/wkd
Diffstat (limited to 'test/unit/wkd/url_test.rb')
-rw-r--r-- | test/unit/wkd/url_test.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/unit/wkd/url_test.rb b/test/unit/wkd/url_test.rb new file mode 100644 index 0000000..9bf8f64 --- /dev/null +++ b/test/unit/wkd/url_test.rb @@ -0,0 +1,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 |