twitter 5.1.1 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. data.tar.gz.sig +0 -0
  2. data/.yardopts +2 -0
  3. data/CHANGELOG.md +10 -1
  4. data/CONTRIBUTING.md +2 -2
  5. data/README.md +30 -20
  6. data/Rakefile +26 -5
  7. data/lib/twitter/arguments.rb +0 -1
  8. data/lib/twitter/base.rb +13 -16
  9. data/lib/twitter/basic_user.rb +3 -3
  10. data/lib/twitter/client.rb +7 -8
  11. data/lib/twitter/configuration.rb +5 -5
  12. data/lib/twitter/core_ext/enumerable.rb +0 -2
  13. data/lib/twitter/core_ext/kernel.rb +0 -2
  14. data/lib/twitter/creatable.rb +0 -1
  15. data/lib/twitter/cursor.rb +7 -10
  16. data/lib/twitter/direct_message.rb +1 -1
  17. data/lib/twitter/entity/uri.rb +2 -2
  18. data/lib/twitter/enumerable.rb +1 -2
  19. data/lib/twitter/error.rb +4 -6
  20. data/lib/twitter/error/already_favorited.rb +1 -1
  21. data/lib/twitter/error/already_posted.rb +1 -1
  22. data/lib/twitter/error/already_retweeted.rb +1 -1
  23. data/lib/twitter/error/too_many_requests.rb +2 -2
  24. data/lib/twitter/factory.rb +2 -6
  25. data/lib/twitter/geo.rb +1 -1
  26. data/lib/twitter/geo/point.rb +3 -5
  27. data/lib/twitter/geo_factory.rb +1 -5
  28. data/lib/twitter/geo_results.rb +5 -8
  29. data/lib/twitter/identity.rb +1 -2
  30. data/lib/twitter/list.rb +4 -5
  31. data/lib/twitter/media/photo.rb +1 -2
  32. data/lib/twitter/media_factory.rb +1 -5
  33. data/lib/twitter/null_object.rb +4 -6
  34. data/lib/twitter/oembed.rb +1 -1
  35. data/lib/twitter/place.rb +4 -5
  36. data/lib/twitter/profile_banner.rb +1 -3
  37. data/lib/twitter/rate_limit.rb +1 -3
  38. data/lib/twitter/relationship.rb +1 -2
  39. data/lib/twitter/rest/api/direct_messages.rb +13 -14
  40. data/lib/twitter/rest/api/favorites.rb +10 -11
  41. data/lib/twitter/rest/api/friends_and_followers.rb +36 -36
  42. data/lib/twitter/rest/api/help.rb +8 -9
  43. data/lib/twitter/rest/api/lists.rb +62 -63
  44. data/lib/twitter/rest/api/oauth.rb +3 -4
  45. data/lib/twitter/rest/api/places_and_geo.rb +9 -10
  46. data/lib/twitter/rest/api/saved_searches.rb +5 -6
  47. data/lib/twitter/rest/api/search.rb +2 -3
  48. data/lib/twitter/rest/api/spam_reporting.rb +1 -2
  49. data/lib/twitter/rest/api/suggested_users.rb +4 -5
  50. data/lib/twitter/rest/api/timelines.rb +17 -18
  51. data/lib/twitter/rest/api/trends.rb +10 -11
  52. data/lib/twitter/rest/api/tweets.rb +15 -16
  53. data/lib/twitter/rest/api/undocumented.rb +6 -7
  54. data/lib/twitter/rest/api/users.rb +51 -52
  55. data/lib/twitter/rest/api/utils.rb +23 -30
  56. data/lib/twitter/rest/client.rb +8 -9
  57. data/lib/twitter/rest/request/multipart_with_file.rb +0 -1
  58. data/lib/twitter/rest/response/parse_error_json.rb +0 -2
  59. data/lib/twitter/rest/response/parse_json.rb +0 -2
  60. data/lib/twitter/rest/response/raise_error.rb +1 -3
  61. data/lib/twitter/search_results.rb +12 -15
  62. data/lib/twitter/settings.rb +2 -2
  63. data/lib/twitter/size.rb +2 -2
  64. data/lib/twitter/source_user.rb +1 -1
  65. data/lib/twitter/streaming/client.rb +71 -18
  66. data/lib/twitter/streaming/connection.rb +1 -3
  67. data/lib/twitter/streaming/deleted_tweet.rb +8 -0
  68. data/lib/twitter/streaming/event.rb +8 -8
  69. data/lib/twitter/streaming/friend_list.rb +2 -9
  70. data/lib/twitter/streaming/message_parser.rb +13 -7
  71. data/lib/twitter/streaming/response.rb +0 -2
  72. data/lib/twitter/streaming/stall_warning.rb +7 -0
  73. data/lib/twitter/suggestion.rb +0 -1
  74. data/lib/twitter/token.rb +2 -3
  75. data/lib/twitter/trend_results.rb +5 -8
  76. data/lib/twitter/tweet.rb +16 -24
  77. data/lib/twitter/user.rb +30 -32
  78. data/lib/twitter/version.rb +2 -5
  79. data/spec/fixtures/track_streaming_user.json +2 -1
  80. data/spec/helper.rb +6 -2
  81. data/spec/twitter/base_spec.rb +9 -9
  82. data/spec/twitter/basic_user_spec.rb +6 -6
  83. data/spec/twitter/configuration_spec.rb +4 -4
  84. data/spec/twitter/cursor_spec.rb +27 -27
  85. data/spec/twitter/direct_message_spec.rb +36 -36
  86. data/spec/twitter/entity/uri_spec.rb +27 -27
  87. data/spec/twitter/error_spec.rb +21 -21
  88. data/spec/twitter/geo/point_spec.rb +9 -9
  89. data/spec/twitter/geo/polygon_spec.rb +5 -5
  90. data/spec/twitter/geo_factory_spec.rb +7 -7
  91. data/spec/twitter/geo_results_spec.rb +11 -11
  92. data/spec/twitter/geo_spec.rb +5 -5
  93. data/spec/twitter/identifiable_spec.rb +9 -9
  94. data/spec/twitter/list_spec.rb +38 -38
  95. data/spec/twitter/media/photo_spec.rb +54 -54
  96. data/spec/twitter/media_factory_spec.rb +5 -5
  97. data/spec/twitter/null_object_spec.rb +6 -6
  98. data/spec/twitter/oembed_spec.rb +65 -65
  99. data/spec/twitter/place_spec.rb +89 -60
  100. data/spec/twitter/profile_banner_spec.rb +3 -3
  101. data/spec/twitter/rate_limit_spec.rb +18 -18
  102. data/spec/twitter/relationship_spec.rb +16 -16
  103. data/spec/twitter/rest/api/direct_messages_spec.rb +61 -61
  104. data/spec/twitter/rest/api/favorites_spec.rb +93 -93
  105. data/spec/twitter/rest/api/friends_and_followers_spec.rb +349 -349
  106. data/spec/twitter/rest/api/geo_spec.rb +33 -33
  107. data/spec/twitter/rest/api/help_spec.rb +24 -24
  108. data/spec/twitter/rest/api/lists_spec.rb +487 -487
  109. data/spec/twitter/rest/api/oauth_spec.rb +30 -30
  110. data/spec/twitter/rest/api/saved_searches_spec.rb +40 -40
  111. data/spec/twitter/rest/api/search_spec.rb +16 -16
  112. data/spec/twitter/rest/api/spam_reporting_spec.rb +9 -9
  113. data/spec/twitter/rest/api/suggested_users_spec.rb +23 -23
  114. data/spec/twitter/rest/api/timelines_spec.rb +58 -58
  115. data/spec/twitter/rest/api/trends_spec.rb +26 -26
  116. data/spec/twitter/rest/api/tweets_spec.rb +284 -284
  117. data/spec/twitter/rest/api/undocumented_spec.rb +51 -51
  118. data/spec/twitter/rest/api/users_spec.rb +360 -360
  119. data/spec/twitter/rest/client_spec.rb +99 -103
  120. data/spec/twitter/saved_search_spec.rb +16 -16
  121. data/spec/twitter/search_results_spec.rb +44 -44
  122. data/spec/twitter/settings_spec.rb +8 -8
  123. data/spec/twitter/size_spec.rb +5 -5
  124. data/spec/twitter/source_user_spec.rb +6 -6
  125. data/spec/twitter/streaming/client_spec.rb +53 -49
  126. data/spec/twitter/streaming/deleted_tweet_spec.rb +23 -0
  127. data/spec/twitter/streaming/event_spec.rb +20 -22
  128. data/spec/twitter/streaming/friend_list_spec.rb +11 -0
  129. data/spec/twitter/streaming/message_parser_spec.rb +54 -0
  130. data/spec/twitter/suggestion_spec.rb +11 -11
  131. data/spec/twitter/target_user_spec.rb +6 -6
  132. data/spec/twitter/token_spec.rb +4 -4
  133. data/spec/twitter/trend_results_spec.rb +30 -30
  134. data/spec/twitter/trend_spec.rb +20 -20
  135. data/spec/twitter/tweet_spec.rb +170 -173
  136. data/spec/twitter/user_spec.rb +179 -179
  137. data/twitter.gemspec +2 -2
  138. metadata +21 -4
  139. metadata.gz.sig +2 -1
@@ -3,332 +3,332 @@ require 'helper'
3
3
 
4
4
  describe Twitter::User do
5
5
 
6
- describe "#==" do
7
- it "returns true when objects IDs are the same" do
8
- user = Twitter::User.new(:id => 1, :screen_name => "foo")
9
- other = Twitter::User.new(:id => 1, :screen_name => "bar")
6
+ describe '#==' do
7
+ it 'returns true when objects IDs are the same' do
8
+ user = Twitter::User.new(:id => 1, :screen_name => 'foo')
9
+ other = Twitter::User.new(:id => 1, :screen_name => 'bar')
10
10
  expect(user == other).to be true
11
11
  end
12
- it "returns false when objects IDs are different" do
12
+ it 'returns false when objects IDs are different' do
13
13
  user = Twitter::User.new(:id => 1)
14
14
  other = Twitter::User.new(:id => 2)
15
15
  expect(user == other).to be false
16
16
  end
17
- it "returns false when classes are different" do
17
+ it 'returns false when classes are different' do
18
18
  user = Twitter::User.new(:id => 1)
19
19
  other = Twitter::Identity.new(:id => 1)
20
20
  expect(user == other).to be false
21
21
  end
22
22
  end
23
23
 
24
- describe "#created_at" do
25
- it "returns a Time when created_at is set" do
26
- user = Twitter::User.new(:id => 7505382, :created_at => "Mon Jul 16 12:59:01 +0000 2007")
24
+ describe '#created_at' do
25
+ it 'returns a Time when created_at is set' do
26
+ user = Twitter::User.new(:id => 7_505_382, :created_at => 'Mon Jul 16 12:59:01 +0000 2007')
27
27
  expect(user.created_at).to be_a Time
28
28
  end
29
- it "returns nil when created_at is not set" do
30
- user = Twitter::User.new(:id => 7505382)
29
+ it 'returns nil when created_at is not set' do
30
+ user = Twitter::User.new(:id => 7_505_382)
31
31
  expect(user.created_at).to be_nil
32
32
  end
33
33
  end
34
34
 
35
- describe "#created?" do
36
- it "returns true when created_at is set" do
37
- user = Twitter::User.new(:id => 7505382, :created_at => "Mon Jul 16 12:59:01 +0000 2007")
35
+ describe '#created?' do
36
+ it 'returns true when created_at is set' do
37
+ user = Twitter::User.new(:id => 7_505_382, :created_at => 'Mon Jul 16 12:59:01 +0000 2007')
38
38
  expect(user.created?).to be true
39
39
  end
40
- it "returns false when created_at is not set" do
41
- user = Twitter::User.new(:id => 7505382)
40
+ it 'returns false when created_at is not set' do
41
+ user = Twitter::User.new(:id => 7_505_382)
42
42
  expect(user.created?).to be false
43
43
  end
44
44
  end
45
45
 
46
- describe "#description_uris" do
47
- it "returns an array of Entity::URIs when entities are set" do
46
+ describe '#description_uris' do
47
+ it 'returns an array of Entity::URIs when entities are set' do
48
48
  urls_array = [
49
49
  {
50
- :url => "http://example.com/t.co",
51
- :expanded_url => "http://example.com/expanded",
52
- :display_url => "example.com/expanded…",
50
+ :url => 'http://example.com/t.co',
51
+ :expanded_url => 'http://example.com/expanded',
52
+ :display_url => 'example.com/expanded…',
53
53
  :indices => [10, 33],
54
54
  }
55
55
  ]
56
- user = Twitter::User.new(:id => 7505382, :entities => {:description => {:urls => urls_array}})
56
+ user = Twitter::User.new(:id => 7_505_382, :entities => {:description => {:urls => urls_array}})
57
57
  expect(user.description_uris).to be_an Array
58
58
  expect(user.description_uris.first).to be_a Twitter::Entity::URI
59
59
  expect(user.description_uris.first.indices).to eq([10, 33])
60
- expect(user.description_uris.first.display_uri).to eq("example.com/expanded…")
60
+ expect(user.description_uris.first.display_uri).to eq('example.com/expanded…')
61
61
  end
62
- it "is empty when not set" do
63
- user = Twitter::User.new(:id => 7505382, :entities => {:description => {:urls => []}})
62
+ it 'is empty when not set' do
63
+ user = Twitter::User.new(:id => 7_505_382, :entities => {:description => {:urls => []}})
64
64
  expect(user.description_uris).to be_empty
65
65
  end
66
66
  end
67
67
 
68
- describe "#profile_banner_uri" do
69
- it "accepts utf8 urls" do
70
- user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581©_normal.png")
68
+ describe '#profile_banner_uri' do
69
+ it 'accepts utf8 urls' do
70
+ user = Twitter::User.new(:id => 7_505_382, :profile_banner_url => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581©_normal.png')
71
71
  expect(user.profile_banner_uri).to be_a Addressable::URI
72
72
  end
73
- it "returns a URI when profile_banner_url is set" do
74
- user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581")
73
+ it 'returns a URI when profile_banner_url is set' do
74
+ user = Twitter::User.new(:id => 7_505_382, :profile_banner_url => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581')
75
75
  expect(user.profile_banner_uri).to be_a Addressable::URI
76
76
  end
77
- it "returns nil when profile_banner_uri is not set" do
78
- user = Twitter::User.new(:id => 7505382)
77
+ it 'returns nil when profile_banner_uri is not set' do
78
+ user = Twitter::User.new(:id => 7_505_382)
79
79
  expect(user.profile_banner_uri).to be_nil
80
80
  end
81
- it "returns the web-sized image" do
82
- user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581")
83
- expect(user.profile_banner_uri.to_s).to eq("http://si0.twimg.com/profile_banners/7505382/1348266581/web")
81
+ it 'returns the web-sized image' do
82
+ user = Twitter::User.new(:id => 7_505_382, :profile_banner_url => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581')
83
+ expect(user.profile_banner_uri.to_s).to eq('http://si0.twimg.com/profile_banners/7_505_382/1348266581/web')
84
84
  end
85
- context "with :web_retina passed" do
86
- it "returns the web retina-sized image" do
87
- user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581")
88
- expect(user.profile_banner_uri(:web_retina).to_s).to eq("http://si0.twimg.com/profile_banners/7505382/1348266581/web_retina")
85
+ context 'with :web_retina passed' do
86
+ it 'returns the web retina-sized image' do
87
+ user = Twitter::User.new(:id => 7_505_382, :profile_banner_url => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581')
88
+ expect(user.profile_banner_uri(:web_retina).to_s).to eq('http://si0.twimg.com/profile_banners/7_505_382/1348266581/web_retina')
89
89
  end
90
90
  end
91
- context "with :mobile passed" do
92
- it "returns the mobile-sized image" do
93
- user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581")
94
- expect(user.profile_banner_uri(:mobile).to_s).to eq("http://si0.twimg.com/profile_banners/7505382/1348266581/mobile")
91
+ context 'with :mobile passed' do
92
+ it 'returns the mobile-sized image' do
93
+ user = Twitter::User.new(:id => 7_505_382, :profile_banner_url => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581')
94
+ expect(user.profile_banner_uri(:mobile).to_s).to eq('http://si0.twimg.com/profile_banners/7_505_382/1348266581/mobile')
95
95
  end
96
96
  end
97
- context "with :mobile_retina passed" do
98
- it "returns the mobile retina-sized image" do
99
- user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581")
100
- expect(user.profile_banner_uri(:mobile_retina).to_s).to eq("http://si0.twimg.com/profile_banners/7505382/1348266581/mobile_retina")
97
+ context 'with :mobile_retina passed' do
98
+ it 'returns the mobile retina-sized image' do
99
+ user = Twitter::User.new(:id => 7_505_382, :profile_banner_url => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581')
100
+ expect(user.profile_banner_uri(:mobile_retina).to_s).to eq('http://si0.twimg.com/profile_banners/7_505_382/1348266581/mobile_retina')
101
101
  end
102
102
  end
103
- context "with :ipad passed" do
104
- it "returns the mobile-sized image" do
105
- user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581")
106
- expect(user.profile_banner_uri(:ipad).to_s).to eq("http://si0.twimg.com/profile_banners/7505382/1348266581/ipad")
103
+ context 'with :ipad passed' do
104
+ it 'returns the mobile-sized image' do
105
+ user = Twitter::User.new(:id => 7_505_382, :profile_banner_url => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581')
106
+ expect(user.profile_banner_uri(:ipad).to_s).to eq('http://si0.twimg.com/profile_banners/7_505_382/1348266581/ipad')
107
107
  end
108
108
  end
109
- context "with :ipad_retina passed" do
110
- it "returns the mobile retina-sized image" do
111
- user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581")
112
- expect(user.profile_banner_uri(:ipad_retina).to_s).to eq("http://si0.twimg.com/profile_banners/7505382/1348266581/ipad_retina")
109
+ context 'with :ipad_retina passed' do
110
+ it 'returns the mobile retina-sized image' do
111
+ user = Twitter::User.new(:id => 7_505_382, :profile_banner_url => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581')
112
+ expect(user.profile_banner_uri(:ipad_retina).to_s).to eq('http://si0.twimg.com/profile_banners/7_505_382/1348266581/ipad_retina')
113
113
  end
114
114
  end
115
115
  end
116
116
 
117
- describe "#profile_banner_uri_https" do
118
- it "accepts utf8 urls" do
119
- user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581©_normal.png")
117
+ describe '#profile_banner_uri_https' do
118
+ it 'accepts utf8 urls' do
119
+ user = Twitter::User.new(:id => 7_505_382, :profile_banner_url => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581©_normal.png')
120
120
  expect(user.profile_banner_uri_https).to be_a Addressable::URI
121
121
  end
122
- it "returns a URI when profile_banner_url is set" do
123
- user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581")
122
+ it 'returns a URI when profile_banner_url is set' do
123
+ user = Twitter::User.new(:id => 7_505_382, :profile_banner_url => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581')
124
124
  expect(user.profile_banner_uri_https).to be_a Addressable::URI
125
125
  end
126
- it "returns nil when created_at is not set" do
127
- user = Twitter::User.new(:id => 7505382)
126
+ it 'returns nil when created_at is not set' do
127
+ user = Twitter::User.new(:id => 7_505_382)
128
128
  expect(user.profile_banner_uri_https).to be_nil
129
129
  end
130
- it "returns the web-sized image" do
131
- user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581")
132
- expect(user.profile_banner_uri_https.to_s).to eq("https://si0.twimg.com/profile_banners/7505382/1348266581/web")
130
+ it 'returns the web-sized image' do
131
+ user = Twitter::User.new(:id => 7_505_382, :profile_banner_url => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581')
132
+ expect(user.profile_banner_uri_https.to_s).to eq('https://si0.twimg.com/profile_banners/7_505_382/1348266581/web')
133
133
  end
134
- context "with :web_retina passed" do
135
- it "returns the web retina-sized image" do
136
- user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581")
137
- expect(user.profile_banner_uri_https(:web_retina).to_s).to eq("https://si0.twimg.com/profile_banners/7505382/1348266581/web_retina")
134
+ context 'with :web_retina passed' do
135
+ it 'returns the web retina-sized image' do
136
+ user = Twitter::User.new(:id => 7_505_382, :profile_banner_url => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581')
137
+ expect(user.profile_banner_uri_https(:web_retina).to_s).to eq('https://si0.twimg.com/profile_banners/7_505_382/1348266581/web_retina')
138
138
  end
139
139
  end
140
- context "with :mobile passed" do
141
- it "returns the mobile-sized image" do
142
- user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581")
143
- expect(user.profile_banner_uri_https(:mobile).to_s).to eq("https://si0.twimg.com/profile_banners/7505382/1348266581/mobile")
140
+ context 'with :mobile passed' do
141
+ it 'returns the mobile-sized image' do
142
+ user = Twitter::User.new(:id => 7_505_382, :profile_banner_url => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581')
143
+ expect(user.profile_banner_uri_https(:mobile).to_s).to eq('https://si0.twimg.com/profile_banners/7_505_382/1348266581/mobile')
144
144
  end
145
145
  end
146
- context "with :mobile_retina passed" do
147
- it "returns the mobile retina-sized image" do
148
- user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581")
149
- expect(user.profile_banner_uri_https(:mobile_retina).to_s).to eq("https://si0.twimg.com/profile_banners/7505382/1348266581/mobile_retina")
146
+ context 'with :mobile_retina passed' do
147
+ it 'returns the mobile retina-sized image' do
148
+ user = Twitter::User.new(:id => 7_505_382, :profile_banner_url => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581')
149
+ expect(user.profile_banner_uri_https(:mobile_retina).to_s).to eq('https://si0.twimg.com/profile_banners/7_505_382/1348266581/mobile_retina')
150
150
  end
151
151
  end
152
- context "with :ipad passed" do
153
- it "returns the mobile-sized image" do
154
- user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581")
155
- expect(user.profile_banner_uri_https(:ipad).to_s).to eq("https://si0.twimg.com/profile_banners/7505382/1348266581/ipad")
152
+ context 'with :ipad passed' do
153
+ it 'returns the mobile-sized image' do
154
+ user = Twitter::User.new(:id => 7_505_382, :profile_banner_url => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581')
155
+ expect(user.profile_banner_uri_https(:ipad).to_s).to eq('https://si0.twimg.com/profile_banners/7_505_382/1348266581/ipad')
156
156
  end
157
157
  end
158
- context "with :ipad_retina passed" do
159
- it "returns the mobile retina-sized image" do
160
- user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581")
161
- expect(user.profile_banner_uri_https(:ipad_retina).to_s).to eq("https://si0.twimg.com/profile_banners/7505382/1348266581/ipad_retina")
158
+ context 'with :ipad_retina passed' do
159
+ it 'returns the mobile retina-sized image' do
160
+ user = Twitter::User.new(:id => 7_505_382, :profile_banner_url => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581')
161
+ expect(user.profile_banner_uri_https(:ipad_retina).to_s).to eq('https://si0.twimg.com/profile_banners/7_505_382/1348266581/ipad_retina')
162
162
  end
163
163
  end
164
164
  end
165
165
 
166
- describe "#profile_banner_uri?" do
167
- it "returns true when profile_banner_url is set" do
168
- user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581")
166
+ describe '#profile_banner_uri?' do
167
+ it 'returns true when profile_banner_url is set' do
168
+ user = Twitter::User.new(:id => 7_505_382, :profile_banner_url => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581')
169
169
  expect(user.profile_banner_uri?).to be true
170
170
  end
171
- it "returns false when profile_banner_url is not set" do
172
- user = Twitter::User.new(:id => 7505382)
171
+ it 'returns false when profile_banner_url is not set' do
172
+ user = Twitter::User.new(:id => 7_505_382)
173
173
  expect(user.profile_banner_uri?).to be false
174
174
  end
175
175
  end
176
176
 
177
- describe "#profile_image_uri" do
178
- it "accepts utf8 urls" do
179
- user = Twitter::User.new(:id => 7505382, :profile_image_url_https => "https://si0.twimg.com/profile_images/7505382/1348266581©_normal.png")
177
+ describe '#profile_image_uri' do
178
+ it 'accepts utf8 urls' do
179
+ user = Twitter::User.new(:id => 7_505_382, :profile_image_url_https => 'https://si0.twimg.com/profile_images/7_505_382/1348266581©_normal.png')
180
180
  expect(user.profile_image_uri).to be_a Addressable::URI
181
181
  end
182
- it "returns a URI when profile_image_url_https is set" do
183
- user = Twitter::User.new(:id => 7505382, :profile_image_url_https => "https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png")
182
+ it 'returns a URI when profile_image_url_https is set' do
183
+ user = Twitter::User.new(:id => 7_505_382, :profile_image_url_https => 'https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png')
184
184
  expect(user.profile_image_uri).to be_a Addressable::URI
185
185
  end
186
- it "returns nil when created_at is not set" do
187
- user = Twitter::User.new(:id => 7505382)
186
+ it 'returns nil when created_at is not set' do
187
+ user = Twitter::User.new(:id => 7_505_382)
188
188
  expect(user.profile_image_uri).to be_nil
189
189
  end
190
- it "returns the normal-sized image" do
191
- user = Twitter::User.new(:id => 7505382, :profile_image_url_https => "https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png")
192
- expect(user.profile_image_uri.to_s).to eq("http://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png")
190
+ it 'returns the normal-sized image' do
191
+ user = Twitter::User.new(:id => 7_505_382, :profile_image_url_https => 'https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png')
192
+ expect(user.profile_image_uri.to_s).to eq('http://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png')
193
193
  end
194
- context "with :original passed" do
195
- it "returns the original image" do
196
- user = Twitter::User.new(:id => 7505382, :profile_image_url_https => "https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png")
197
- expect(user.profile_image_uri(:original).to_s).to eq("http://a0.twimg.com/profile_images/1759857427/image1326743606.png")
194
+ context 'with :original passed' do
195
+ it 'returns the original image' do
196
+ user = Twitter::User.new(:id => 7_505_382, :profile_image_url_https => 'https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png')
197
+ expect(user.profile_image_uri(:original).to_s).to eq('http://a0.twimg.com/profile_images/1759857427/image1326743606.png')
198
198
  end
199
199
  end
200
- context "with :bigger passed" do
201
- it "returns the bigger-sized image" do
202
- user = Twitter::User.new(:id => 7505382, :profile_image_url_https => "https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png")
203
- expect(user.profile_image_uri(:bigger).to_s).to eq("http://a0.twimg.com/profile_images/1759857427/image1326743606_bigger.png")
200
+ context 'with :bigger passed' do
201
+ it 'returns the bigger-sized image' do
202
+ user = Twitter::User.new(:id => 7_505_382, :profile_image_url_https => 'https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png')
203
+ expect(user.profile_image_uri(:bigger).to_s).to eq('http://a0.twimg.com/profile_images/1759857427/image1326743606_bigger.png')
204
204
  end
205
205
  end
206
- context "with :mini passed" do
207
- it "returns the mini-sized image" do
208
- user = Twitter::User.new(:id => 7505382, :profile_image_url_https => "https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png")
209
- expect(user.profile_image_uri(:mini).to_s).to eq("http://a0.twimg.com/profile_images/1759857427/image1326743606_mini.png")
206
+ context 'with :mini passed' do
207
+ it 'returns the mini-sized image' do
208
+ user = Twitter::User.new(:id => 7_505_382, :profile_image_url_https => 'https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png')
209
+ expect(user.profile_image_uri(:mini).to_s).to eq('http://a0.twimg.com/profile_images/1759857427/image1326743606_mini.png')
210
210
  end
211
211
  end
212
- context "with capitalized file extension" do
213
- it "returns the correct image" do
214
- user = Twitter::User.new(:id => 7505382, :profile_image_url_https => "https://si0.twimg.com/profile_images/67759670/DSCN2136_normal.JPG")
215
- expect(user.profile_image_uri(:original).to_s).to eq("http://si0.twimg.com/profile_images/67759670/DSCN2136.JPG")
216
- expect(user.profile_image_uri(:bigger).to_s).to eq("http://si0.twimg.com/profile_images/67759670/DSCN2136_bigger.JPG")
217
- expect(user.profile_image_uri(:mini).to_s).to eq("http://si0.twimg.com/profile_images/67759670/DSCN2136_mini.JPG")
212
+ context 'with capitalized file extension' do
213
+ it 'returns the correct image' do
214
+ user = Twitter::User.new(:id => 7_505_382, :profile_image_url_https => 'https://si0.twimg.com/profile_images/67759670/DSCN2136_normal.JPG')
215
+ expect(user.profile_image_uri(:original).to_s).to eq('http://si0.twimg.com/profile_images/67759670/DSCN2136.JPG')
216
+ expect(user.profile_image_uri(:bigger).to_s).to eq('http://si0.twimg.com/profile_images/67759670/DSCN2136_bigger.JPG')
217
+ expect(user.profile_image_uri(:mini).to_s).to eq('http://si0.twimg.com/profile_images/67759670/DSCN2136_mini.JPG')
218
218
  end
219
219
  end
220
220
  end
221
221
 
222
- describe "#profile_image_uri_https" do
223
- it "accepts utf8 urls" do
224
- user = Twitter::User.new(:id => 7505382, :profile_image_url_https => "https://si0.twimg.com/profile_images/7505382/1348266581©_normal.png")
222
+ describe '#profile_image_uri_https' do
223
+ it 'accepts utf8 urls' do
224
+ user = Twitter::User.new(:id => 7_505_382, :profile_image_url_https => 'https://si0.twimg.com/profile_images/7_505_382/1348266581©_normal.png')
225
225
  expect(user.profile_image_uri_https).to be_a Addressable::URI
226
226
  end
227
- it "returns a URI when profile_image_url_https is set" do
228
- user = Twitter::User.new(:id => 7505382, :profile_image_url_https => "https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png")
227
+ it 'returns a URI when profile_image_url_https is set' do
228
+ user = Twitter::User.new(:id => 7_505_382, :profile_image_url_https => 'https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png')
229
229
  expect(user.profile_image_uri_https).to be_a Addressable::URI
230
230
  end
231
- it "returns nil when created_at is not set" do
232
- user = Twitter::User.new(:id => 7505382)
231
+ it 'returns nil when created_at is not set' do
232
+ user = Twitter::User.new(:id => 7_505_382)
233
233
  expect(user.profile_image_uri_https).to be_nil
234
234
  end
235
- it "returns the normal-sized image" do
236
- user = Twitter::User.new(:id => 7505382, :profile_image_url_https => "https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png")
237
- expect(user.profile_image_uri_https.to_s).to eq("https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png")
235
+ it 'returns the normal-sized image' do
236
+ user = Twitter::User.new(:id => 7_505_382, :profile_image_url_https => 'https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png')
237
+ expect(user.profile_image_uri_https.to_s).to eq('https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png')
238
238
  end
239
- context "with :original passed" do
240
- it "returns the original image" do
241
- user = Twitter::User.new(:id => 7505382, :profile_image_url_https => "https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png")
242
- expect(user.profile_image_uri_https(:original).to_s).to eq("https://a0.twimg.com/profile_images/1759857427/image1326743606.png")
239
+ context 'with :original passed' do
240
+ it 'returns the original image' do
241
+ user = Twitter::User.new(:id => 7_505_382, :profile_image_url_https => 'https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png')
242
+ expect(user.profile_image_uri_https(:original).to_s).to eq('https://a0.twimg.com/profile_images/1759857427/image1326743606.png')
243
243
  end
244
244
  end
245
- context "with :bigger passed" do
246
- it "returns the bigger-sized image" do
247
- user = Twitter::User.new(:id => 7505382, :profile_image_url_https => "https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png")
248
- expect(user.profile_image_uri_https(:bigger).to_s).to eq("https://a0.twimg.com/profile_images/1759857427/image1326743606_bigger.png")
245
+ context 'with :bigger passed' do
246
+ it 'returns the bigger-sized image' do
247
+ user = Twitter::User.new(:id => 7_505_382, :profile_image_url_https => 'https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png')
248
+ expect(user.profile_image_uri_https(:bigger).to_s).to eq('https://a0.twimg.com/profile_images/1759857427/image1326743606_bigger.png')
249
249
  end
250
250
  end
251
- context "with :mini passed" do
252
- it "returns the mini-sized image" do
253
- user = Twitter::User.new(:id => 7505382, :profile_image_url_https => "https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png")
254
- expect(user.profile_image_uri_https(:mini).to_s).to eq("https://a0.twimg.com/profile_images/1759857427/image1326743606_mini.png")
251
+ context 'with :mini passed' do
252
+ it 'returns the mini-sized image' do
253
+ user = Twitter::User.new(:id => 7_505_382, :profile_image_url_https => 'https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png')
254
+ expect(user.profile_image_uri_https(:mini).to_s).to eq('https://a0.twimg.com/profile_images/1759857427/image1326743606_mini.png')
255
255
  end
256
256
  end
257
- context "with capitalized file extension" do
258
- it "returns the correct image" do
259
- user = Twitter::User.new(:id => 7505382, :profile_image_url_https => "https://si0.twimg.com/profile_images/67759670/DSCN2136_normal.JPG")
260
- expect(user.profile_image_uri_https(:original).to_s).to eq("https://si0.twimg.com/profile_images/67759670/DSCN2136.JPG")
261
- expect(user.profile_image_uri_https(:bigger).to_s).to eq("https://si0.twimg.com/profile_images/67759670/DSCN2136_bigger.JPG")
262
- expect(user.profile_image_uri_https(:mini).to_s).to eq("https://si0.twimg.com/profile_images/67759670/DSCN2136_mini.JPG")
257
+ context 'with capitalized file extension' do
258
+ it 'returns the correct image' do
259
+ user = Twitter::User.new(:id => 7_505_382, :profile_image_url_https => 'https://si0.twimg.com/profile_images/67759670/DSCN2136_normal.JPG')
260
+ expect(user.profile_image_uri_https(:original).to_s).to eq('https://si0.twimg.com/profile_images/67759670/DSCN2136.JPG')
261
+ expect(user.profile_image_uri_https(:bigger).to_s).to eq('https://si0.twimg.com/profile_images/67759670/DSCN2136_bigger.JPG')
262
+ expect(user.profile_image_uri_https(:mini).to_s).to eq('https://si0.twimg.com/profile_images/67759670/DSCN2136_mini.JPG')
263
263
  end
264
264
  end
265
265
  end
266
266
 
267
- describe "#profile_image_uri?" do
268
- it "returns true when profile_image_url_https is set" do
269
- user = Twitter::User.new(:id => 7505382, :profile_image_url_https => "https://si0.twimg.com/profile_banners/7505382/1348266581")
267
+ describe '#profile_image_uri?' do
268
+ it 'returns true when profile_image_url_https is set' do
269
+ user = Twitter::User.new(:id => 7_505_382, :profile_image_url_https => 'https://si0.twimg.com/profile_banners/7_505_382/1348266581')
270
270
  expect(user.profile_image_uri?).to be true
271
271
  end
272
- it "returns false when profile_image_url_https is not set" do
273
- user = Twitter::User.new(:id => 7505382)
272
+ it 'returns false when profile_image_url_https is not set' do
273
+ user = Twitter::User.new(:id => 7_505_382)
274
274
  expect(user.profile_image_uri?).to be false
275
275
  end
276
276
  end
277
277
 
278
- describe "#status" do
279
- it "returns a Status when status is set" do
280
- user = Twitter::User.new(:id => 7505382, :status => {:id => 25938088801})
278
+ describe '#status' do
279
+ it 'returns a Status when status is set' do
280
+ user = Twitter::User.new(:id => 7_505_382, :status => {:id => 25_938_088_801})
281
281
  expect(user.status).to be_a Twitter::Tweet
282
282
  end
283
- it "returns nil when status is not set" do
284
- user = Twitter::User.new(:id => 7505382)
283
+ it 'returns nil when status is not set' do
284
+ user = Twitter::User.new(:id => 7_505_382)
285
285
  expect(user.status).to be_nil
286
286
  end
287
- it "has a user" do
288
- user = Twitter::User.new(:id => 7505382, :status => {:id => 25938088801})
287
+ it 'has a user' do
288
+ user = Twitter::User.new(:id => 7_505_382, :status => {:id => 25_938_088_801})
289
289
  expect(user.status.user).to be_a Twitter::User
290
- expect(user.status.user.id).to eq(7505382)
290
+ expect(user.status.user.id).to eq(7_505_382)
291
291
  end
292
292
  end
293
293
 
294
- describe "#status?" do
295
- it "returns true when status is set" do
296
- user = Twitter::User.new(:id => 7505382, :status => {:id => 25938088801})
294
+ describe '#status?' do
295
+ it 'returns true when status is set' do
296
+ user = Twitter::User.new(:id => 7_505_382, :status => {:id => 25_938_088_801})
297
297
  expect(user.status?).to be true
298
298
  end
299
- it "returns false when status is not set" do
300
- user = Twitter::User.new(:id => 7505382)
299
+ it 'returns false when status is not set' do
300
+ user = Twitter::User.new(:id => 7_505_382)
301
301
  expect(user.status?).to be false
302
302
  end
303
303
  end
304
304
 
305
- describe "#uri" do
306
- it "returns the URI to the user" do
307
- user = Twitter::User.new(:id => 7505382, :screen_name => "sferik")
305
+ describe '#uri' do
306
+ it 'returns the URI to the user' do
307
+ user = Twitter::User.new(:id => 7_505_382, :screen_name => 'sferik')
308
308
  expect(user.uri).to be_a Addressable::URI
309
- expect(user.uri.to_s).to eq("https://twitter.com/sferik")
309
+ expect(user.uri.to_s).to eq('https://twitter.com/sferik')
310
310
  end
311
311
  end
312
312
 
313
- describe "#website" do
314
- it "returns a URI when the url is set" do
315
- user = Twitter::User.new(:id => 7505382, :url => "https://github.com/sferik")
313
+ describe '#website' do
314
+ it 'returns a URI when the url is set' do
315
+ user = Twitter::User.new(:id => 7_505_382, :url => 'https://github.com/sferik')
316
316
  expect(user.website).to be_a Addressable::URI
317
- expect(user.website.to_s).to eq("https://github.com/sferik")
317
+ expect(user.website.to_s).to eq('https://github.com/sferik')
318
318
  end
319
- it "returns nil when the url is not set" do
320
- user = Twitter::User.new(:id => 7505382)
319
+ it 'returns nil when the url is not set' do
320
+ user = Twitter::User.new(:id => 7_505_382)
321
321
  expect(user.website).to be_nil
322
322
  end
323
323
  end
324
324
 
325
- describe "#website?" do
326
- it "returns true when the url is set" do
327
- user = Twitter::User.new(:id => 7505382, :url => "https://github.com/sferik")
325
+ describe '#website?' do
326
+ it 'returns true when the url is set' do
327
+ user = Twitter::User.new(:id => 7_505_382, :url => 'https://github.com/sferik')
328
328
  expect(user.website?).to be true
329
329
  end
330
- it "returns false when the url is not set" do
331
- user = Twitter::User.new(:id => 7505382)
330
+ it 'returns false when the url is not set' do
331
+ user = Twitter::User.new(:id => 7_505_382)
332
332
  expect(user.website?).to be false
333
333
  end
334
334
  end