File: util_spec.rb

package info (click to toggle)
ruby-acme-client 2.10.really.2.0.18-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,132 kB
  • sloc: ruby: 2,217; makefile: 7; sh: 3
file content (16 lines) | stat: -rw-r--r-- 462 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'spec_helper'

describe Acme::Client::JWK do
  context '#decode_link_headers' do
    let(:example) do
      '<uri1>; rel="up", <uri2>; rel="alt", <uri3>; rel="alt"'
    end

    it 'extract link value and in a hash with rel as they key' do
      links = Acme::Client::Util.decode_link_headers(example)
      expect(links).to be_a(Hash)
      expect(links['up']).to eq(['uri1'])
      expect(links['alt'].sort).to eq(%w(uri2 uri3).sort)
    end
  end
end