Skip to content

Commit

Permalink
Remove deprecated Twitter::Status#expanded_urls method
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Jun 2, 2012
1 parent 4259925 commit 50d2613
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
7 changes: 0 additions & 7 deletions lib/twitter/status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ def ==(other)
super || (other.class == self.class && other.id == self.id)
end

# @note Must include entities in your request for this method to work
# @return [Array<String>]
def expanded_urls
warn "#{Kernel.caller.first}: [DEPRECATION] Twitter::Status#expanded_urls it deprecated. Use Twitter::Status#urls instead."
urls.map(&:expanded_url) unless urls.nil?
end

# @note If favoriters_count is > 50 it will return the string 50+.
# @return [String]
def favoriters_count
Expand Down
17 changes: 0 additions & 17 deletions spec/twitter/status_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,6 @@
end
end

describe "#expanded_urls" do
it "should return the expanded urls" do
urls = [{'expanded_url' => 'http://example.com'}]
expanded_urls = Twitter::Status.new('entities' => {'urls' => urls}).expanded_urls
expanded_urls.should be_an Array
expanded_urls.first.should == "http://example.com"
end
it "should return nil when not set" do
expanded_urls = Twitter::Status.new.expanded_urls
expanded_urls.should be_nil
end
it "should warn when not set" do
Twitter::Status.new.expanded_urls
$stderr.string.should =~ /\[DEPRECATION\] Twitter::Status#expanded_urls it deprecated\. Use Twitter::Status#urls instead\./
end
end

describe "#favoriters_count" do
it "should return the count of favoriters when favoriters_count is set" do
status = Twitter::Status.new('favoriters_count' => '1')
Expand Down

0 comments on commit 50d2613

Please sign in to comment.