Skip to content

Commit

Permalink
goodbye VK::Client#offline?
Browse files Browse the repository at this point in the history
  • Loading branch information
7even committed Dec 17, 2012
1 parent 7273d4c commit a51bde0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
5 changes: 0 additions & 5 deletions lib/vkontakte_api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ def expired?
@expires_at && @expires_at < Time.now
end

# Is the token permanent.
def offline?
@expires_at.nil?
end

# Access rights of this token.
# @return [Array] An array of symbols representing the access rights.
def scope
Expand Down
24 changes: 0 additions & 24 deletions spec/vkontakte_api/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,30 +88,6 @@
end
end

describe "#offline?" do
context "with a usual token" do
it "returns false" do
VkontakteApi::Client.new(@oauth2_token).should_not be_offline
end
end

context "with an offline token" do
before(:each) do
@oauth2_token.stub(:expires_at).and_return(nil)
end

it "returns true" do
VkontakteApi::Client.new(@oauth2_token).should be_offline
end
end

context "with a String token" do
it "returns true" do
VkontakteApi::Client.new(@string_token).should be_offline
end
end
end

describe "#scope" do
before(:each) do
@client = VkontakteApi::Client.new
Expand Down

0 comments on commit a51bde0

Please sign in to comment.