sferik/twitter — pull request #453 by michaelherold (2013-09-16 22:23:21+00:00)
Title: Fix behavior of Twitter::Tweet.entities? method.

Previously, this method returned true when inflating a tweet that has no entities because the inflated model does not set ```@attrs[:entities]``` to ```nil```, but to a hash of empty lists.

For example:

```ruby
> tweet = Twitter.status(372706156361576448)
=> #"Wed Aug 28 13:04:06 +0000 2013",
:id=>372706156361576448,
# snip extras for brevity
:entities=>{:hashtags=>[], :symbols=>[], :urls=>[], :user_mentions=>[]},
:favorited=>false,
:retweeted=>false,
:lang=>"en"}
> tweet.entities?
=> true
```

This pull request fixes this behavior to properly return ```false``` in this case. It also adds a spec to test this behavior. I opted to change this method as it seems less likely to affect things than changing the inflating method to set to ```nil```.