json-jwt 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of json-jwt might be problematic. Click here for more details.
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/json/jwk/set.rb +2 -1
- data/spec/json/jwk/set_spec.rb +18 -18
- metadata +1 -1
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
data/lib/json/jwk/set.rb
CHANGED
data/spec/json/jwk/set_spec.rb
CHANGED
@@ -2,34 +2,34 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe JSON::JWK::Set do
|
4
4
|
let(:jwk) { JSON::JWK.new public_key }
|
5
|
+
let(:set) { JSON::JWK::Set.new jwk }
|
5
6
|
|
6
7
|
context 'when single JWK given' do
|
7
|
-
|
8
|
-
|
9
|
-
it 'should become proper JWK set format' do
|
10
|
-
_set_ = set.as_json
|
11
|
-
_set_.should include :keys
|
12
|
-
_set_[:keys].should == [jwk]
|
13
|
-
end
|
8
|
+
subject { JSON::JWK::Set.new jwk }
|
9
|
+
it { should == [jwk] }
|
14
10
|
end
|
15
11
|
|
16
12
|
context 'when multiple JWKs given' do
|
17
|
-
|
18
|
-
|
19
|
-
it 'should become proper JWK set format' do
|
20
|
-
_set_ = set.as_json
|
21
|
-
_set_.should include :keys
|
22
|
-
_set_[:keys].should == [jwk, jwk]
|
23
|
-
end
|
13
|
+
subject { JSON::JWK::Set.new jwk, jwk }
|
14
|
+
it { should == [jwk, jwk] }
|
24
15
|
end
|
25
16
|
|
26
17
|
context 'when an Array of JWKs given' do
|
27
|
-
|
18
|
+
subject { JSON::JWK::Set.new [jwk, jwk] }
|
19
|
+
it { should == [jwk, jwk] }
|
20
|
+
end
|
28
21
|
|
22
|
+
describe '#as_json' do
|
29
23
|
it 'should become proper JWK set format' do
|
30
|
-
|
31
|
-
|
32
|
-
|
24
|
+
json = set.as_json
|
25
|
+
json.should include :keys
|
26
|
+
json[:keys].should == [jwk]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '#to_json' do
|
31
|
+
it do
|
32
|
+
expect { set.to_json }.not_to raise_error
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|