oauth2 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,6 +44,7 @@ module OAuth2
44
44
  end
45
45
  @expires_in ||= opts.delete('expires')
46
46
  @expires_in &&= @expires_in.to_i
47
+ @expires_at &&= @expires_at.to_i
47
48
  @expires_at ||= Time.now.to_i + @expires_in if @expires_in
48
49
  @options = {:mode => opts.delete(:mode) || :header,
49
50
  :header_format => opts.delete(:header_format) || 'Bearer %s',
@@ -2,7 +2,7 @@ module OAuth2
2
2
  class Version
3
3
  MAJOR = 0 unless defined? MAJOR
4
4
  MINOR = 8 unless defined? MINOR
5
- PATCH = 0 unless defined? PATCH
5
+ PATCH = 1 unless defined? PATCH
6
6
  PRE = nil unless defined? PRE
7
7
 
8
8
  class << self
@@ -59,6 +59,13 @@ describe AccessToken do
59
59
  target.options[:header_format].should == 'Bearer %'
60
60
  target.options[:mode].should == :body
61
61
  end
62
+
63
+ it "initializes with a string expires_at" do
64
+ hash = {:access_token => token, :expires_at => '1361396829', 'foo' => 'bar'}
65
+ target = AccessToken.from_hash(client, hash)
66
+ assert_initialized_token(target)
67
+ expect(target.expires_at).to be_a(Integer)
68
+ end
62
69
  end
63
70
 
64
71
  describe '#request' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-07-01 00:00:00.000000000 Z
13
+ date: 2013-02-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday