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 CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- json-jwt (0.1.2)
4
+ json-jwt (0.1.4)
5
5
  activesupport (>= 2.3)
6
6
  i18n
7
7
  json (>= 1.4.3)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
data/lib/json/jwk/set.rb CHANGED
@@ -5,7 +5,8 @@ module JSON
5
5
  end
6
6
 
7
7
  def as_json(options = {})
8
- {:keys => self}
8
+ # NOTE: Array.new wrapper is requied to avoid CircularReferenceError
9
+ {:keys => Array.new(self)}
9
10
  end
10
11
  end
11
12
  end
@@ -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
- let(:set) { JSON::JWK::Set.new jwk }
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
- let(:set) { JSON::JWK::Set.new jwk, jwk }
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
- let(:set) { JSON::JWK::Set.new [jwk, jwk] }
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
- _set_ = set.as_json
31
- _set_.should include :keys
32
- _set_[:keys].should == [jwk, jwk]
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json-jwt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: