Skip to content

Commit

Permalink
Cleanup #453
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Sep 17, 2013
1 parent 969ef65 commit 452d243
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions lib/twitter/tweet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ class Tweet < Twitter::Identity

# @return [Boolean]
def entities?
return false if @attrs[:entities].nil?

@attrs[:entities].any? { |k, v| !v.empty? }
!@attrs[:entities].nil? && @attrs[:entities].any?{|_, array| !array.empty?}
end

def filter_level
Expand Down
3 changes: 1 addition & 2 deletions spec/twitter/tweet_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@
end

it "returns false if there are blank lists of entities set" do
urls_array = []
tweet = Twitter::Tweet.new(:id => 28669546014, :entities => {:urls => urls_array})
tweet = Twitter::Tweet.new(:id => 28669546014, :entities => {:urls => []})
expect(tweet.entities?).to be_false
end

Expand Down

0 comments on commit 452d243

Please sign in to comment.