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,99 +3,99 @@ require 'helper'
3
3
  describe Twitter::REST::API::Undocumented do
4
4
 
5
5
  before do
6
- @client = Twitter::REST::Client.new(:consumer_key => "CK", :consumer_secret => "CS", :access_token => "AT", :access_token_secret => "AS")
6
+ @client = Twitter::REST::Client.new(:consumer_key => 'CK', :consumer_secret => 'CS', :access_token => 'AT', :access_token_secret => 'AS')
7
7
  end
8
8
 
9
- describe "#following_followers_of" do
10
- context "with a screen_name passed" do
9
+ describe '#following_followers_of' do
10
+ context 'with a screen_name passed' do
11
11
  before do
12
- stub_get("/users/following_followers_of.json").with(:query => {:cursor => "-1", :screen_name => "sferik"}).to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
12
+ stub_get('/users/following_followers_of.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'}).to_return(:body => fixture('users_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
13
13
  end
14
- it "requests the correct resource" do
15
- @client.following_followers_of("sferik")
16
- expect(a_get("/users/following_followers_of.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
14
+ it 'requests the correct resource' do
15
+ @client.following_followers_of('sferik')
16
+ expect(a_get('/users/following_followers_of.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
17
17
  end
18
- it "returns an array of numeric IDs for every user following the specified user" do
19
- following_followers_of = @client.following_followers_of("sferik")
18
+ it 'returns an array of numeric IDs for every user following the specified user' do
19
+ following_followers_of = @client.following_followers_of('sferik')
20
20
  expect(following_followers_of).to be_a Twitter::Cursor
21
21
  expect(following_followers_of.first).to be_a Twitter::User
22
22
  end
23
- context "with each" do
23
+ context 'with each' do
24
24
  before do
25
- stub_get("/users/following_followers_of.json").with(:query => {:cursor => "1322801608223717003", :screen_name => "sferik"}).to_return(:body => fixture("users_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
25
+ stub_get('/users/following_followers_of.json').with(:query => {:cursor => '1322801608223717003', :screen_name => 'sferik'}).to_return(:body => fixture('users_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
26
26
  end
27
- it "requests the correct resource" do
28
- @client.following_followers_of("sferik").each{}
29
- expect(a_get("/users/following_followers_of.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
30
- expect(a_get("/users/following_followers_of.json").with(:query => {:cursor => "1322801608223717003", :screen_name => "sferik"})).to have_been_made
27
+ it 'requests the correct resource' do
28
+ @client.following_followers_of('sferik').each {}
29
+ expect(a_get('/users/following_followers_of.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
30
+ expect(a_get('/users/following_followers_of.json').with(:query => {:cursor => '1322801608223717003', :screen_name => 'sferik'})).to have_been_made
31
31
  end
32
32
  end
33
33
  end
34
- context "with a user ID passed" do
34
+ context 'with a user ID passed' do
35
35
  before do
36
- stub_get("/users/following_followers_of.json").with(:query => {:cursor => "-1", :user_id => "7505382"}).to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
36
+ stub_get('/users/following_followers_of.json').with(:query => {:cursor => '-1', :user_id => '7505382'}).to_return(:body => fixture('users_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
37
37
  end
38
- it "requests the correct resource" do
39
- @client.following_followers_of(7505382)
40
- expect(a_get("/users/following_followers_of.json").with(:query => {:cursor => "-1", :user_id => "7505382"})).to have_been_made
38
+ it 'requests the correct resource' do
39
+ @client.following_followers_of(7_505_382)
40
+ expect(a_get('/users/following_followers_of.json').with(:query => {:cursor => '-1', :user_id => '7505382'})).to have_been_made
41
41
  end
42
- context "with each" do
42
+ context 'with each' do
43
43
  before do
44
- stub_get("/users/following_followers_of.json").with(:query => {:cursor => "1322801608223717003", :user_id => "7505382"}).to_return(:body => fixture("users_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
44
+ stub_get('/users/following_followers_of.json').with(:query => {:cursor => '1322801608223717003', :user_id => '7505382'}).to_return(:body => fixture('users_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
45
45
  end
46
- it "requests the correct resource" do
47
- @client.following_followers_of(7505382).each{}
48
- expect(a_get("/users/following_followers_of.json").with(:query => {:cursor => "-1", :user_id => "7505382"})).to have_been_made
49
- expect(a_get("/users/following_followers_of.json").with(:query => {:cursor => "1322801608223717003", :user_id => "7505382"})).to have_been_made
46
+ it 'requests the correct resource' do
47
+ @client.following_followers_of(7_505_382).each {}
48
+ expect(a_get('/users/following_followers_of.json').with(:query => {:cursor => '-1', :user_id => '7505382'})).to have_been_made
49
+ expect(a_get('/users/following_followers_of.json').with(:query => {:cursor => '1322801608223717003', :user_id => '7505382'})).to have_been_made
50
50
  end
51
51
  end
52
52
  end
53
- context "without arguments passed" do
53
+ context 'without arguments passed' do
54
54
  before do
55
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
56
- stub_get("/users/following_followers_of.json").with(:query => {:cursor => "-1", :screen_name => "sferik"}).to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
55
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
56
+ stub_get('/users/following_followers_of.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'}).to_return(:body => fixture('users_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
57
57
  end
58
- it "requests the correct resource" do
58
+ it 'requests the correct resource' do
59
59
  @client.following_followers_of
60
- expect(a_get("/1.1/account/verify_credentials.json")).to have_been_made
61
- expect(a_get("/users/following_followers_of.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
60
+ expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
61
+ expect(a_get('/users/following_followers_of.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
62
62
  end
63
- it "returns an array of numeric IDs for every user following the specified user" do
63
+ it 'returns an array of numeric IDs for every user following the specified user' do
64
64
  following_followers_of = @client.following_followers_of
65
65
  expect(following_followers_of).to be_a Twitter::Cursor
66
66
  expect(following_followers_of.first).to be_a Twitter::User
67
67
  end
68
- context "with each" do
68
+ context 'with each' do
69
69
  before do
70
- stub_get("/users/following_followers_of.json").with(:query => {:cursor => "1322801608223717003", :screen_name => "sferik"}).to_return(:body => fixture("users_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
70
+ stub_get('/users/following_followers_of.json').with(:query => {:cursor => '1322801608223717003', :screen_name => 'sferik'}).to_return(:body => fixture('users_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
71
71
  end
72
- it "requests the correct resource" do
73
- @client.following_followers_of.each{}
74
- expect(a_get("/users/following_followers_of.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
75
- expect(a_get("/users/following_followers_of.json").with(:query => {:cursor => "1322801608223717003", :screen_name => "sferik"})).to have_been_made
72
+ it 'requests the correct resource' do
73
+ @client.following_followers_of.each {}
74
+ expect(a_get('/users/following_followers_of.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
75
+ expect(a_get('/users/following_followers_of.json').with(:query => {:cursor => '1322801608223717003', :screen_name => 'sferik'})).to have_been_made
76
76
  end
77
77
  end
78
78
  end
79
79
  end
80
80
 
81
- describe "#tweet_count" do
81
+ describe '#tweet_count' do
82
82
  before do
83
- stub_request(:get, "https://cdn.api.twitter.com/1/urls/count.json").with(:query => {:url => "http://twitter.com"}).to_return(:body => fixture("count.json"), :headers => {:content_type => "application/json; charset=utf-8"})
83
+ stub_request(:get, 'https://cdn.api.twitter.com/1/urls/count.json').with(:query => {:url => 'http://twitter.com'}).to_return(:body => fixture('count.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
84
84
  end
85
- it "requests the correct resource" do
86
- @client.tweet_count("http://twitter.com")
87
- expect(a_request(:get, "https://cdn.api.twitter.com/1/urls/count.json").with(:query => {:url => "http://twitter.com"})).to have_been_made
85
+ it 'requests the correct resource' do
86
+ @client.tweet_count('http://twitter.com')
87
+ expect(a_request(:get, 'https://cdn.api.twitter.com/1/urls/count.json').with(:query => {:url => 'http://twitter.com'})).to have_been_made
88
88
  end
89
- it "returns a Tweet count" do
90
- tweet_count = @client.tweet_count("http://twitter.com")
89
+ it 'returns a Tweet count' do
90
+ tweet_count = @client.tweet_count('http://twitter.com')
91
91
  expect(tweet_count).to be_an Integer
92
- expect(tweet_count).to eq(13845465)
92
+ expect(tweet_count).to eq(13_845_465)
93
93
  end
94
- context "with a URI" do
95
- it "requests the correct resource" do
96
- uri = URI.parse("http://twitter.com")
94
+ context 'with a URI' do
95
+ it 'requests the correct resource' do
96
+ uri = URI.parse('http://twitter.com')
97
97
  @client.tweet_count(uri)
98
- expect(a_request(:get, "https://cdn.api.twitter.com/1/urls/count.json").with(:query => {:url => "http://twitter.com"})).to have_been_made
98
+ expect(a_request(:get, 'https://cdn.api.twitter.com/1/urls/count.json').with(:query => {:url => 'http://twitter.com'})).to have_been_made
99
99
  end
100
100
  end
101
101
  end
@@ -3,633 +3,633 @@ require 'helper'
3
3
  describe Twitter::REST::API::Users do
4
4
 
5
5
  before do
6
- @client = Twitter::REST::Client.new(:consumer_key => "CK", :consumer_secret => "CS", :access_token => "AT", :access_token_secret => "AS")
6
+ @client = Twitter::REST::Client.new(:consumer_key => 'CK', :consumer_secret => 'CS', :access_token => 'AT', :access_token_secret => 'AS')
7
7
  end
8
8
 
9
- describe "#settings" do
9
+ describe '#settings' do
10
10
  before do
11
- stub_get("/1.1/account/settings.json").to_return(:body => fixture("settings.json"), :headers => {:content_type => "application/json; charset=utf-8"})
12
- stub_post("/1.1/account/settings.json").with(:body => {:trend_location_woeid => "23424803"}).to_return(:body => fixture("settings.json"), :headers => {:content_type => "application/json; charset=utf-8"})
11
+ stub_get('/1.1/account/settings.json').to_return(:body => fixture('settings.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
12
+ stub_post('/1.1/account/settings.json').with(:body => {:trend_location_woeid => '23424803'}).to_return(:body => fixture('settings.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
13
13
  end
14
- it "requests the correct resource on GET" do
14
+ it 'requests the correct resource on GET' do
15
15
  @client.settings
16
- expect(a_get("/1.1/account/settings.json")).to have_been_made
16
+ expect(a_get('/1.1/account/settings.json')).to have_been_made
17
17
  end
18
- it "returns settings" do
18
+ it 'returns settings' do
19
19
  settings = @client.settings
20
20
  expect(settings).to be_a Twitter::Settings
21
- expect(settings.language).to eq("en")
21
+ expect(settings.language).to eq('en')
22
22
  end
23
- it "requests the correct resource on POST" do
24
- @client.settings(:trend_location_woeid => "23424803")
25
- expect(a_post("/1.1/account/settings.json").with(:body => {:trend_location_woeid => "23424803"})).to have_been_made
23
+ it 'requests the correct resource on POST' do
24
+ @client.settings(:trend_location_woeid => '23424803')
25
+ expect(a_post('/1.1/account/settings.json').with(:body => {:trend_location_woeid => '23424803'})).to have_been_made
26
26
  end
27
- it "returns settings" do
28
- settings = @client.settings(:trend_location_woeid => "23424803")
27
+ it 'returns settings' do
28
+ settings = @client.settings(:trend_location_woeid => '23424803')
29
29
  expect(settings).to be_a Twitter::Settings
30
- expect(settings.language).to eq("en")
30
+ expect(settings.language).to eq('en')
31
31
  end
32
32
  end
33
33
 
34
- describe "#verify_credentials" do
34
+ describe '#verify_credentials' do
35
35
  before do
36
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
36
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
37
37
  end
38
- it "requests the correct resource" do
38
+ it 'requests the correct resource' do
39
39
  @client.verify_credentials
40
- expect(a_get("/1.1/account/verify_credentials.json")).to have_been_made
40
+ expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
41
41
  end
42
- it "returns the requesting user" do
42
+ it 'returns the requesting user' do
43
43
  user = @client.verify_credentials
44
44
  expect(user).to be_a Twitter::User
45
- expect(user.id).to eq(7505382)
45
+ expect(user.id).to eq(7_505_382)
46
46
  end
47
47
  end
48
48
 
49
- describe "#update_delivery_device" do
49
+ describe '#update_delivery_device' do
50
50
  before do
51
- stub_post("/1.1/account/update_delivery_device.json").with(:body => {:device => "sms"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
51
+ stub_post('/1.1/account/update_delivery_device.json').with(:body => {:device => 'sms'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
52
52
  end
53
- it "requests the correct resource" do
54
- @client.update_delivery_device("sms")
55
- expect(a_post("/1.1/account/update_delivery_device.json").with(:body => {:device => "sms"})).to have_been_made
53
+ it 'requests the correct resource' do
54
+ @client.update_delivery_device('sms')
55
+ expect(a_post('/1.1/account/update_delivery_device.json').with(:body => {:device => 'sms'})).to have_been_made
56
56
  end
57
- it "returns a user" do
58
- user = @client.update_delivery_device("sms")
57
+ it 'returns a user' do
58
+ user = @client.update_delivery_device('sms')
59
59
  expect(user).to be_a Twitter::User
60
- expect(user.id).to eq(7505382)
60
+ expect(user.id).to eq(7_505_382)
61
61
  end
62
62
  end
63
63
 
64
- describe "#update_profile" do
64
+ describe '#update_profile' do
65
65
  before do
66
- stub_post("/1.1/account/update_profile.json").with(:body => {:url => "http://github.com/sferik/"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
66
+ stub_post('/1.1/account/update_profile.json').with(:body => {:url => 'http://github.com/sferik/'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
67
67
  end
68
- it "requests the correct resource" do
69
- @client.update_profile(:url => "http://github.com/sferik/")
70
- expect(a_post("/1.1/account/update_profile.json").with(:body => {:url => "http://github.com/sferik/"})).to have_been_made
68
+ it 'requests the correct resource' do
69
+ @client.update_profile(:url => 'http://github.com/sferik/')
70
+ expect(a_post('/1.1/account/update_profile.json').with(:body => {:url => 'http://github.com/sferik/'})).to have_been_made
71
71
  end
72
- it "returns a user" do
73
- user = @client.update_profile(:url => "http://github.com/sferik/")
72
+ it 'returns a user' do
73
+ user = @client.update_profile(:url => 'http://github.com/sferik/')
74
74
  expect(user).to be_a Twitter::User
75
- expect(user.id).to eq(7505382)
75
+ expect(user.id).to eq(7_505_382)
76
76
  end
77
77
  end
78
78
 
79
- describe "#update_profile_background_image" do
79
+ describe '#update_profile_background_image' do
80
80
  before do
81
- stub_post("/1.1/account/update_profile_background_image.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
81
+ stub_post('/1.1/account/update_profile_background_image.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
82
82
  end
83
- it "requests the correct resource" do
84
- @client.update_profile_background_image(fixture("we_concept_bg2.png"))
85
- expect(a_post("/1.1/account/update_profile_background_image.json")).to have_been_made
83
+ it 'requests the correct resource' do
84
+ @client.update_profile_background_image(fixture('we_concept_bg2.png'))
85
+ expect(a_post('/1.1/account/update_profile_background_image.json')).to have_been_made
86
86
  end
87
- it "returns a user" do
88
- user = @client.update_profile_background_image(fixture("we_concept_bg2.png"))
87
+ it 'returns a user' do
88
+ user = @client.update_profile_background_image(fixture('we_concept_bg2.png'))
89
89
  expect(user).to be_a Twitter::User
90
- expect(user.id).to eq(7505382)
90
+ expect(user.id).to eq(7_505_382)
91
91
  end
92
92
  end
93
93
 
94
- describe "#update_profile_colors" do
94
+ describe '#update_profile_colors' do
95
95
  before do
96
- stub_post("/1.1/account/update_profile_colors.json").with(:body => {:profile_background_color => "000000"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
96
+ stub_post('/1.1/account/update_profile_colors.json').with(:body => {:profile_background_color => '000000'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
97
97
  end
98
- it "requests the correct resource" do
99
- @client.update_profile_colors(:profile_background_color => "000000")
100
- expect(a_post("/1.1/account/update_profile_colors.json").with(:body => {:profile_background_color => "000000"})).to have_been_made
98
+ it 'requests the correct resource' do
99
+ @client.update_profile_colors(:profile_background_color => '000000')
100
+ expect(a_post('/1.1/account/update_profile_colors.json').with(:body => {:profile_background_color => '000000'})).to have_been_made
101
101
  end
102
- it "returns a user" do
103
- user = @client.update_profile_colors(:profile_background_color => "000000")
102
+ it 'returns a user' do
103
+ user = @client.update_profile_colors(:profile_background_color => '000000')
104
104
  expect(user).to be_a Twitter::User
105
- expect(user.id).to eq(7505382)
105
+ expect(user.id).to eq(7_505_382)
106
106
  end
107
107
  end
108
108
 
109
- describe "#update_profile_image" do
109
+ describe '#update_profile_image' do
110
110
  before do
111
- stub_post("/1.1/account/update_profile_image.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
111
+ stub_post('/1.1/account/update_profile_image.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
112
112
  end
113
- it "requests the correct resource" do
114
- @client.update_profile_image(fixture("me.jpeg"))
115
- expect(a_post("/1.1/account/update_profile_image.json")).to have_been_made
113
+ it 'requests the correct resource' do
114
+ @client.update_profile_image(fixture('me.jpeg'))
115
+ expect(a_post('/1.1/account/update_profile_image.json')).to have_been_made
116
116
  end
117
- it "returns a user" do
118
- user = @client.update_profile_image(fixture("me.jpeg"))
117
+ it 'returns a user' do
118
+ user = @client.update_profile_image(fixture('me.jpeg'))
119
119
  expect(user).to be_a Twitter::User
120
- expect(user.id).to eq(7505382)
120
+ expect(user.id).to eq(7_505_382)
121
121
  end
122
122
  end
123
123
 
124
- describe "#suggestions" do
125
- context "with a category slug passed" do
124
+ describe '#suggestions' do
125
+ context 'with a category slug passed' do
126
126
  before do
127
- stub_get("/1.1/users/suggestions/art-design.json").to_return(:body => fixture("category.json"), :headers => {:content_type => "application/json; charset=utf-8"})
127
+ stub_get('/1.1/users/suggestions/art-design.json').to_return(:body => fixture('category.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
128
128
  end
129
- it "requests the correct resource" do
130
- @client.suggestions("art-design")
131
- expect(a_get("/1.1/users/suggestions/art-design.json")).to have_been_made
129
+ it 'requests the correct resource' do
130
+ @client.suggestions('art-design')
131
+ expect(a_get('/1.1/users/suggestions/art-design.json')).to have_been_made
132
132
  end
133
- it "returns the users in a given category of the Twitter suggested user list" do
134
- suggestion = @client.suggestions("art-design")
133
+ it 'returns the users in a given category of the Twitter suggested user list' do
134
+ suggestion = @client.suggestions('art-design')
135
135
  expect(suggestion).to be_a Twitter::Suggestion
136
- expect(suggestion.name).to eq("Art & Design")
136
+ expect(suggestion.name).to eq('Art & Design')
137
137
  expect(suggestion.users).to be_an Array
138
138
  expect(suggestion.users.first).to be_a Twitter::User
139
139
  end
140
140
  end
141
- context "without arguments passed" do
141
+ context 'without arguments passed' do
142
142
  before do
143
- stub_get("/1.1/users/suggestions.json").to_return(:body => fixture("suggestions.json"), :headers => {:content_type => "application/json; charset=utf-8"})
143
+ stub_get('/1.1/users/suggestions.json').to_return(:body => fixture('suggestions.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
144
144
  end
145
- it "requests the correct resource" do
145
+ it 'requests the correct resource' do
146
146
  @client.suggestions
147
- expect(a_get("/1.1/users/suggestions.json")).to have_been_made
147
+ expect(a_get('/1.1/users/suggestions.json')).to have_been_made
148
148
  end
149
- it "returns the list of suggested user categories" do
149
+ it 'returns the list of suggested user categories' do
150
150
  suggestions = @client.suggestions
151
151
  expect(suggestions).to be_an Array
152
152
  expect(suggestions.first).to be_a Twitter::Suggestion
153
- expect(suggestions.first.name).to eq("Art & Design")
153
+ expect(suggestions.first.name).to eq('Art & Design')
154
154
  end
155
155
  end
156
156
  end
157
157
 
158
- describe "#suggest_users" do
158
+ describe '#suggest_users' do
159
159
  before do
160
- stub_get("/1.1/users/suggestions/art-design/members.json").to_return(:body => fixture("members.json"), :headers => {:content_type => "application/json; charset=utf-8"})
160
+ stub_get('/1.1/users/suggestions/art-design/members.json').to_return(:body => fixture('members.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
161
161
  end
162
- it "requests the correct resource" do
163
- @client.suggest_users("art-design")
164
- expect(a_get("/1.1/users/suggestions/art-design/members.json")).to have_been_made
162
+ it 'requests the correct resource' do
163
+ @client.suggest_users('art-design')
164
+ expect(a_get('/1.1/users/suggestions/art-design/members.json')).to have_been_made
165
165
  end
166
- it "returns users in a given category of the Twitter suggested user list and return their most recent status if they are not a protected user" do
167
- suggest_users = @client.suggest_users("art-design")
166
+ it 'returns users in a given category of the Twitter suggested user list and return their most recent status if they are not a protected user' do
167
+ suggest_users = @client.suggest_users('art-design')
168
168
  expect(suggest_users).to be_an Array
169
169
  expect(suggest_users.first).to be_a Twitter::User
170
170
  expect(suggest_users.first.id).to eq(13)
171
171
  end
172
172
  end
173
173
 
174
- describe "#blocking" do
174
+ describe '#blocking' do
175
175
  before do
176
- stub_get("/1.1/blocks/list.json").with(:query => {:cursor => "-1"}).to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
176
+ stub_get('/1.1/blocks/list.json').with(:query => {:cursor => '-1'}).to_return(:body => fixture('users_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
177
177
  end
178
- it "requests the correct resource" do
178
+ it 'requests the correct resource' do
179
179
  @client.blocking
180
- expect(a_get("/1.1/blocks/list.json").with(:query => {:cursor => "-1"})).to have_been_made
180
+ expect(a_get('/1.1/blocks/list.json').with(:query => {:cursor => '-1'})).to have_been_made
181
181
  end
182
- it "returns an array of user objects that the authenticating user is blocking" do
182
+ it 'returns an array of user objects that the authenticating user is blocking' do
183
183
  blocking = @client.blocking
184
184
  expect(blocking).to be_a Twitter::Cursor
185
185
  expect(blocking.first).to be_a Twitter::User
186
- expect(blocking.first.id).to eq(7505382)
186
+ expect(blocking.first.id).to eq(7_505_382)
187
187
  end
188
- context "with each" do
188
+ context 'with each' do
189
189
  before do
190
- stub_get("/1.1/blocks/list.json").with(:query => {:cursor => "1322801608223717003"}).to_return(:body => fixture("users_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
190
+ stub_get('/1.1/blocks/list.json').with(:query => {:cursor => '1322801608223717003'}).to_return(:body => fixture('users_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
191
191
  end
192
- it "requests the correct resource" do
193
- @client.blocking.each{}
194
- expect(a_get("/1.1/blocks/list.json").with(:query => {:cursor => "-1"})).to have_been_made
195
- expect(a_get("/1.1/blocks/list.json").with(:query => {:cursor => "1322801608223717003"})).to have_been_made
192
+ it 'requests the correct resource' do
193
+ @client.blocking.each {}
194
+ expect(a_get('/1.1/blocks/list.json').with(:query => {:cursor => '-1'})).to have_been_made
195
+ expect(a_get('/1.1/blocks/list.json').with(:query => {:cursor => '1322801608223717003'})).to have_been_made
196
196
  end
197
197
  end
198
198
  end
199
199
 
200
- describe "#blocked_ids" do
200
+ describe '#blocked_ids' do
201
201
  before do
202
- stub_get("/1.1/blocks/ids.json").with(:query => {:cursor => "-1"}).to_return(:body => fixture("ids_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
202
+ stub_get('/1.1/blocks/ids.json').with(:query => {:cursor => '-1'}).to_return(:body => fixture('ids_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
203
203
  end
204
- it "requests the correct resource" do
204
+ it 'requests the correct resource' do
205
205
  @client.blocked_ids
206
- expect(a_get("/1.1/blocks/ids.json").with(:query => {:cursor => "-1"})).to have_been_made
206
+ expect(a_get('/1.1/blocks/ids.json').with(:query => {:cursor => '-1'})).to have_been_made
207
207
  end
208
- it "returns an array of numeric user IDs the authenticating user is blocking" do
208
+ it 'returns an array of numeric user IDs the authenticating user is blocking' do
209
209
  blocked_ids = @client.blocked_ids
210
210
  expect(blocked_ids).to be_a Twitter::Cursor
211
- expect(blocked_ids.first).to eq(20009713)
211
+ expect(blocked_ids.first).to eq(20_009_713)
212
212
  end
213
- context "with each" do
213
+ context 'with each' do
214
214
  before do
215
- stub_get("/1.1/blocks/ids.json").with(:query => {:cursor => "1305102810874389703"}).to_return(:body => fixture("ids_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
215
+ stub_get('/1.1/blocks/ids.json').with(:query => {:cursor => '1305102810874389703'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
216
216
  end
217
- it "requests the correct resource" do
218
- @client.blocked_ids.each{}
219
- expect(a_get("/1.1/blocks/ids.json").with(:query => {:cursor => "-1"})).to have_been_made
220
- expect(a_get("/1.1/blocks/ids.json").with(:query => {:cursor => "1305102810874389703"})).to have_been_made
217
+ it 'requests the correct resource' do
218
+ @client.blocked_ids.each {}
219
+ expect(a_get('/1.1/blocks/ids.json').with(:query => {:cursor => '-1'})).to have_been_made
220
+ expect(a_get('/1.1/blocks/ids.json').with(:query => {:cursor => '1305102810874389703'})).to have_been_made
221
221
  end
222
222
  end
223
223
  end
224
224
 
225
- describe "#block?" do
226
- context "with a screen name passed" do
225
+ describe '#block?' do
226
+ context 'with a screen name passed' do
227
227
  before do
228
- stub_get("/1.1/blocks/ids.json").with(:query => {:cursor => "-1"}).to_return(:body => fixture("ids_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
229
- stub_get("/1.1/blocks/ids.json").with(:query => {:cursor => "1305102810874389703"}).to_return(:body => fixture("ids_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
230
- stub_get("/1.1/users/show.json").with(:query => {:screen_name => "pengwynn"}).to_return(:body => fixture("pengwynn.json"), :headers => {:content_type => "application/json; charset=utf-8"})
231
- stub_get("/1.1/users/show.json").with(:query => {:screen_name => "sferik"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
232
- end
233
- it "requests the correct resource" do
234
- @client.block?("sferik")
235
- expect(a_get("/1.1/blocks/ids.json").with(:query => {:cursor => "-1"})).to have_been_made
236
- expect(a_get("/1.1/blocks/ids.json").with(:query => {:cursor => "1305102810874389703"})).to have_been_made
237
- expect(a_get("/1.1/users/show.json").with(:query => {:screen_name => "sferik"})).to have_been_made
238
- end
239
- it "returns true if block exists" do
240
- block = @client.block?("pengwynn")
228
+ stub_get('/1.1/blocks/ids.json').with(:query => {:cursor => '-1'}).to_return(:body => fixture('ids_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
229
+ stub_get('/1.1/blocks/ids.json').with(:query => {:cursor => '1305102810874389703'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
230
+ stub_get('/1.1/users/show.json').with(:query => {:screen_name => 'pengwynn'}).to_return(:body => fixture('pengwynn.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
231
+ stub_get('/1.1/users/show.json').with(:query => {:screen_name => 'sferik'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
232
+ end
233
+ it 'requests the correct resource' do
234
+ @client.block?('sferik')
235
+ expect(a_get('/1.1/blocks/ids.json').with(:query => {:cursor => '-1'})).to have_been_made
236
+ expect(a_get('/1.1/blocks/ids.json').with(:query => {:cursor => '1305102810874389703'})).to have_been_made
237
+ expect(a_get('/1.1/users/show.json').with(:query => {:screen_name => 'sferik'})).to have_been_made
238
+ end
239
+ it 'returns true if block exists' do
240
+ block = @client.block?('pengwynn')
241
241
  expect(block).to be true
242
242
  end
243
- it "returns false if block does not exist" do
244
- block = @client.block?("sferik")
243
+ it 'returns false if block does not exist' do
244
+ block = @client.block?('sferik')
245
245
  expect(block).to be false
246
246
  end
247
247
  end
248
- context "with a user ID passed" do
248
+ context 'with a user ID passed' do
249
249
  before do
250
- stub_get("/1.1/blocks/ids.json").with(:query => {:cursor => "-1"}).to_return(:body => fixture("ids_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
251
- stub_get("/1.1/blocks/ids.json").with(:query => {:cursor => "1305102810874389703"}).to_return(:body => fixture("ids_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
250
+ stub_get('/1.1/blocks/ids.json').with(:query => {:cursor => '-1'}).to_return(:body => fixture('ids_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
251
+ stub_get('/1.1/blocks/ids.json').with(:query => {:cursor => '1305102810874389703'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
252
252
  end
253
- it "requests the correct resources" do
254
- @client.block?(7505382)
255
- expect(a_get("/1.1/blocks/ids.json").with(:query => {:cursor => "-1"})).to have_been_made
256
- expect(a_get("/1.1/blocks/ids.json").with(:query => {:cursor => "1305102810874389703"})).to have_been_made
253
+ it 'requests the correct resources' do
254
+ @client.block?(7_505_382)
255
+ expect(a_get('/1.1/blocks/ids.json').with(:query => {:cursor => '-1'})).to have_been_made
256
+ expect(a_get('/1.1/blocks/ids.json').with(:query => {:cursor => '1305102810874389703'})).to have_been_made
257
257
  end
258
258
  end
259
- context "with a user object passed" do
259
+ context 'with a user object passed' do
260
260
  before do
261
- stub_get("/1.1/blocks/ids.json").with(:query => {:cursor => "-1"}).to_return(:body => fixture("ids_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
262
- stub_get("/1.1/blocks/ids.json").with(:query => {:cursor => "1305102810874389703"}).to_return(:body => fixture("ids_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
261
+ stub_get('/1.1/blocks/ids.json').with(:query => {:cursor => '-1'}).to_return(:body => fixture('ids_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
262
+ stub_get('/1.1/blocks/ids.json').with(:query => {:cursor => '1305102810874389703'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
263
263
  end
264
- it "requests the correct resources" do
265
- user = Twitter::User.new(:id => "7505382")
264
+ it 'requests the correct resources' do
265
+ user = Twitter::User.new(:id => '7505382')
266
266
  @client.block?(user)
267
- expect(a_get("/1.1/blocks/ids.json").with(:query => {:cursor => "-1"})).to have_been_made
268
- expect(a_get("/1.1/blocks/ids.json").with(:query => {:cursor => "1305102810874389703"})).to have_been_made
267
+ expect(a_get('/1.1/blocks/ids.json').with(:query => {:cursor => '-1'})).to have_been_made
268
+ expect(a_get('/1.1/blocks/ids.json').with(:query => {:cursor => '1305102810874389703'})).to have_been_made
269
269
  end
270
270
  end
271
271
  end
272
272
 
273
- describe "#block" do
273
+ describe '#block' do
274
274
  before do
275
- stub_post("/1.1/blocks/create.json").with(:body => {:screen_name => "sferik"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
275
+ stub_post('/1.1/blocks/create.json').with(:body => {:screen_name => 'sferik'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
276
276
  end
277
- it "requests the correct resource" do
278
- @client.block("sferik")
279
- expect(a_post("/1.1/blocks/create.json")).to have_been_made
277
+ it 'requests the correct resource' do
278
+ @client.block('sferik')
279
+ expect(a_post('/1.1/blocks/create.json')).to have_been_made
280
280
  end
281
- it "returns an array of blocked users" do
282
- users = @client.block("sferik")
281
+ it 'returns an array of blocked users' do
282
+ users = @client.block('sferik')
283
283
  expect(users).to be_an Array
284
284
  expect(users.first).to be_a Twitter::User
285
- expect(users.first.id).to eq(7505382)
285
+ expect(users.first.id).to eq(7_505_382)
286
286
  end
287
287
  end
288
288
 
289
- describe "#unblock" do
289
+ describe '#unblock' do
290
290
  before do
291
- stub_post("/1.1/blocks/destroy.json").with(:body => {:screen_name => "sferik"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
291
+ stub_post('/1.1/blocks/destroy.json').with(:body => {:screen_name => 'sferik'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
292
292
  end
293
- it "requests the correct resource" do
294
- @client.unblock("sferik")
295
- expect(a_post("/1.1/blocks/destroy.json").with(:body => {:screen_name => "sferik"})).to have_been_made
293
+ it 'requests the correct resource' do
294
+ @client.unblock('sferik')
295
+ expect(a_post('/1.1/blocks/destroy.json').with(:body => {:screen_name => 'sferik'})).to have_been_made
296
296
  end
297
- it "returns an array of un-blocked users" do
298
- users = @client.unblock("sferik")
297
+ it 'returns an array of un-blocked users' do
298
+ users = @client.unblock('sferik')
299
299
  expect(users).to be_an Array
300
300
  expect(users.first).to be_a Twitter::User
301
- expect(users.first.id).to eq(7505382)
301
+ expect(users.first.id).to eq(7_505_382)
302
302
  end
303
303
  end
304
304
 
305
- describe "#users" do
306
- context "using a post request" do
307
- context "with screen names passed" do
305
+ describe '#users' do
306
+ context 'using a post request' do
307
+ context 'with screen names passed' do
308
308
  before do
309
- stub_post("/1.1/users/lookup.json").with(:body => {:screen_name => "sferik,pengwynn"}).to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
309
+ stub_post('/1.1/users/lookup.json').with(:body => {:screen_name => 'sferik,pengwynn'}).to_return(:body => fixture('users.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
310
310
  end
311
- it "requests the correct resource" do
312
- @client.users("sferik", "pengwynn")
313
- expect(a_post("/1.1/users/lookup.json").with(:body => {:screen_name => "sferik,pengwynn"})).to have_been_made
311
+ it 'requests the correct resource' do
312
+ @client.users('sferik', 'pengwynn')
313
+ expect(a_post('/1.1/users/lookup.json').with(:body => {:screen_name => 'sferik,pengwynn'})).to have_been_made
314
314
  end
315
- it "returns up to 100 users worth of extended information" do
316
- users = @client.users("sferik", "pengwynn")
315
+ it 'returns up to 100 users worth of extended information' do
316
+ users = @client.users('sferik', 'pengwynn')
317
317
  expect(users).to be_an Array
318
318
  expect(users.first).to be_a Twitter::User
319
- expect(users.first.id).to eq(7505382)
319
+ expect(users.first.id).to eq(7_505_382)
320
320
  end
321
- context "with URI objects passed" do
322
- it "requests the correct resource" do
323
- sferik = URI.parse("https://twitter.com/sferik")
324
- pengwynn = URI.parse("https://twitter.com/pengwynn")
321
+ context 'with URI objects passed' do
322
+ it 'requests the correct resource' do
323
+ sferik = URI.parse('https://twitter.com/sferik')
324
+ pengwynn = URI.parse('https://twitter.com/pengwynn')
325
325
  @client.users(sferik, pengwynn)
326
- expect(a_post("/1.1/users/lookup.json").with(:body => {:screen_name => "sferik,pengwynn"})).to have_been_made
326
+ expect(a_post('/1.1/users/lookup.json').with(:body => {:screen_name => 'sferik,pengwynn'})).to have_been_made
327
327
  end
328
328
  end
329
- context "with URI strings passed" do
330
- it "requests the correct resource" do
331
- @client.users("https://twitter.com/sferik", "https://twitter.com/pengwynn")
332
- expect(a_post("/1.1/users/lookup.json").with(:body => {:screen_name => "sferik,pengwynn"})).to have_been_made
329
+ context 'with URI strings passed' do
330
+ it 'requests the correct resource' do
331
+ @client.users('https://twitter.com/sferik', 'https://twitter.com/pengwynn')
332
+ expect(a_post('/1.1/users/lookup.json').with(:body => {:screen_name => 'sferik,pengwynn'})).to have_been_made
333
333
  end
334
334
  end
335
335
  end
336
- context "with numeric screen names passed" do
336
+ context 'with numeric screen names passed' do
337
337
  before do
338
- stub_post("/1.1/users/lookup.json").with(:body => {:screen_name => "0,311"}).to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
338
+ stub_post('/1.1/users/lookup.json').with(:body => {:screen_name => '0,311'}).to_return(:body => fixture('users.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
339
339
  end
340
- it "requests the correct resource" do
341
- @client.users("0", "311")
342
- expect(a_post("/1.1/users/lookup.json").with(:body => {:screen_name => "0,311"})).to have_been_made
340
+ it 'requests the correct resource' do
341
+ @client.users('0', '311')
342
+ expect(a_post('/1.1/users/lookup.json').with(:body => {:screen_name => '0,311'})).to have_been_made
343
343
  end
344
344
  end
345
- context "with user IDs passed" do
345
+ context 'with user IDs passed' do
346
346
  before do
347
- stub_post("/1.1/users/lookup.json").with(:body => {:user_id => "7505382,14100886"}).to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
347
+ stub_post('/1.1/users/lookup.json').with(:body => {:user_id => '7505382,14100886'}).to_return(:body => fixture('users.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
348
348
  end
349
- it "requests the correct resource" do
350
- @client.users(7505382, 14100886)
351
- expect(a_post("/1.1/users/lookup.json").with(:body => {:user_id => "7505382,14100886"})).to have_been_made
349
+ it 'requests the correct resource' do
350
+ @client.users(7_505_382, 14_100_886)
351
+ expect(a_post('/1.1/users/lookup.json').with(:body => {:user_id => '7505382,14100886'})).to have_been_made
352
352
  end
353
353
  end
354
- context "with both screen names and user IDs passed" do
354
+ context 'with both screen names and user IDs passed' do
355
355
  before do
356
- stub_post("/1.1/users/lookup.json").with(:body => {:screen_name => "sferik", :user_id => "14100886"}).to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
356
+ stub_post('/1.1/users/lookup.json').with(:body => {:screen_name => 'sferik', :user_id => '14100886'}).to_return(:body => fixture('users.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
357
357
  end
358
- it "requests the correct resource" do
359
- @client.users("sferik", 14100886)
360
- expect(a_post("/1.1/users/lookup.json").with(:body => {:screen_name => "sferik", :user_id => "14100886"})).to have_been_made
358
+ it 'requests the correct resource' do
359
+ @client.users('sferik', 14_100_886)
360
+ expect(a_post('/1.1/users/lookup.json').with(:body => {:screen_name => 'sferik', :user_id => '14100886'})).to have_been_made
361
361
  end
362
362
  end
363
- context "with user objects passed" do
363
+ context 'with user objects passed' do
364
364
  before do
365
- stub_post("/1.1/users/lookup.json").with(:body => {:user_id => "7505382,14100886"}).to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
365
+ stub_post('/1.1/users/lookup.json').with(:body => {:user_id => '7505382,14100886'}).to_return(:body => fixture('users.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
366
366
  end
367
- it "requests the correct resource" do
368
- user1 = Twitter::User.new(:id => "7505382")
369
- user2 = Twitter::User.new(:id => "14100886")
367
+ it 'requests the correct resource' do
368
+ user1 = Twitter::User.new(:id => '7505382')
369
+ user2 = Twitter::User.new(:id => '14100886')
370
370
  @client.users(user1, user2)
371
- expect(a_post("/1.1/users/lookup.json").with(:body => {:user_id => "7505382,14100886"})).to have_been_made
371
+ expect(a_post('/1.1/users/lookup.json').with(:body => {:user_id => '7505382,14100886'})).to have_been_made
372
372
  end
373
373
  end
374
374
  end
375
- context "using a get request" do
376
- context "with screen names passed" do
375
+ context 'using a get request' do
376
+ context 'with screen names passed' do
377
377
  before do
378
- stub_get("/1.1/users/lookup.json").with(:query => {:screen_name => "sferik,pengwynn"}).to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
378
+ stub_get('/1.1/users/lookup.json').with(:query => {:screen_name => 'sferik,pengwynn'}).to_return(:body => fixture('users.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
379
379
  end
380
- it "requests the correct resource" do
381
- @client.users("sferik", "pengwynn", :method => :get)
382
- expect(a_get("/1.1/users/lookup.json").with(:query => {:screen_name => "sferik,pengwynn"})).to have_been_made
380
+ it 'requests the correct resource' do
381
+ @client.users('sferik', 'pengwynn', :method => :get)
382
+ expect(a_get('/1.1/users/lookup.json').with(:query => {:screen_name => 'sferik,pengwynn'})).to have_been_made
383
383
  end
384
- it "returns up to 100 users worth of extended information" do
385
- users = @client.users("sferik", "pengwynn", :method => :get)
384
+ it 'returns up to 100 users worth of extended information' do
385
+ users = @client.users('sferik', 'pengwynn', :method => :get)
386
386
  expect(users).to be_an Array
387
387
  expect(users.first).to be_a Twitter::User
388
- expect(users.first.id).to eq(7505382)
388
+ expect(users.first.id).to eq(7_505_382)
389
389
  end
390
- context "with URI objects passed" do
391
- it "requests the correct resource" do
392
- sferik = URI.parse("https://twitter.com/sferik")
393
- pengwynn = URI.parse("https://twitter.com/pengwynn")
390
+ context 'with URI objects passed' do
391
+ it 'requests the correct resource' do
392
+ sferik = URI.parse('https://twitter.com/sferik')
393
+ pengwynn = URI.parse('https://twitter.com/pengwynn')
394
394
  @client.users(sferik, pengwynn, :method => :get)
395
- expect(a_get("/1.1/users/lookup.json").with(:query => {:screen_name => "sferik,pengwynn"})).to have_been_made
395
+ expect(a_get('/1.1/users/lookup.json').with(:query => {:screen_name => 'sferik,pengwynn'})).to have_been_made
396
396
  end
397
397
  end
398
- context "with URI objects passed" do
399
- it "requests the correct resource" do
400
- @client.users("https://twitter.com/sferik", "https://twitter.com/pengwynn", :method => :get)
401
- expect(a_get("/1.1/users/lookup.json").with(:query => {:screen_name => "sferik,pengwynn"})).to have_been_made
398
+ context 'with URI objects passed' do
399
+ it 'requests the correct resource' do
400
+ @client.users('https://twitter.com/sferik', 'https://twitter.com/pengwynn', :method => :get)
401
+ expect(a_get('/1.1/users/lookup.json').with(:query => {:screen_name => 'sferik,pengwynn'})).to have_been_made
402
402
  end
403
403
  end
404
404
  end
405
- context "with numeric screen names passed" do
405
+ context 'with numeric screen names passed' do
406
406
  before do
407
- stub_get("/1.1/users/lookup.json").with(:query => {:screen_name => "0,311"}).to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
407
+ stub_get('/1.1/users/lookup.json').with(:query => {:screen_name => '0,311'}).to_return(:body => fixture('users.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
408
408
  end
409
- it "requests the correct resource" do
410
- @client.users("0", "311", :method => :get)
411
- expect(a_get("/1.1/users/lookup.json").with(:query => {:screen_name => "0,311"})).to have_been_made
409
+ it 'requests the correct resource' do
410
+ @client.users('0', '311', :method => :get)
411
+ expect(a_get('/1.1/users/lookup.json').with(:query => {:screen_name => '0,311'})).to have_been_made
412
412
  end
413
413
  end
414
- context "with user IDs passed" do
414
+ context 'with user IDs passed' do
415
415
  before do
416
- stub_get("/1.1/users/lookup.json").with(:query => {:user_id => "7505382,14100886"}).to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
416
+ stub_get('/1.1/users/lookup.json').with(:query => {:user_id => '7505382,14100886'}).to_return(:body => fixture('users.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
417
417
  end
418
- it "requests the correct resource" do
419
- @client.users(7505382, 14100886, :method => :get)
420
- expect(a_get("/1.1/users/lookup.json").with(:query => {:user_id => "7505382,14100886"})).to have_been_made
418
+ it 'requests the correct resource' do
419
+ @client.users(7_505_382, 14_100_886, :method => :get)
420
+ expect(a_get('/1.1/users/lookup.json').with(:query => {:user_id => '7505382,14100886'})).to have_been_made
421
421
  end
422
422
  end
423
- context "with both screen names and user IDs passed" do
423
+ context 'with both screen names and user IDs passed' do
424
424
  before do
425
- stub_get("/1.1/users/lookup.json").with(:query => {:screen_name => "sferik", :user_id => "14100886"}).to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
425
+ stub_get('/1.1/users/lookup.json').with(:query => {:screen_name => 'sferik', :user_id => '14100886'}).to_return(:body => fixture('users.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
426
426
  end
427
- it "requests the correct resource" do
428
- @client.users("sferik", 14100886, :method => :get)
429
- expect(a_get("/1.1/users/lookup.json").with(:query => {:screen_name => "sferik", :user_id => "14100886"})).to have_been_made
427
+ it 'requests the correct resource' do
428
+ @client.users('sferik', 14_100_886, :method => :get)
429
+ expect(a_get('/1.1/users/lookup.json').with(:query => {:screen_name => 'sferik', :user_id => '14100886'})).to have_been_made
430
430
  end
431
431
  end
432
- context "with user objects passed" do
432
+ context 'with user objects passed' do
433
433
  before do
434
- stub_get("/1.1/users/lookup.json").with(:query => {:user_id => "7505382,14100886"}).to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
434
+ stub_get('/1.1/users/lookup.json').with(:query => {:user_id => '7505382,14100886'}).to_return(:body => fixture('users.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
435
435
  end
436
- it "requests the correct resource" do
437
- user1 = Twitter::User.new(:id => "7505382")
438
- user2 = Twitter::User.new(:id => "14100886")
436
+ it 'requests the correct resource' do
437
+ user1 = Twitter::User.new(:id => '7505382')
438
+ user2 = Twitter::User.new(:id => '14100886')
439
439
  @client.users(user1, user2, :method => :get)
440
- expect(a_get("/1.1/users/lookup.json").with(:query => {:user_id => "7505382,14100886"})).to have_been_made
440
+ expect(a_get('/1.1/users/lookup.json').with(:query => {:user_id => '7505382,14100886'})).to have_been_made
441
441
  end
442
442
  end
443
443
  end
444
444
  end
445
445
 
446
- describe "#user" do
447
- context "with a screen name passed" do
446
+ describe '#user' do
447
+ context 'with a screen name passed' do
448
448
  before do
449
- stub_get("/1.1/users/show.json").with(:query => {:screen_name => "sferik"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
449
+ stub_get('/1.1/users/show.json').with(:query => {:screen_name => 'sferik'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
450
450
  end
451
- it "requests the correct resource" do
452
- @client.user("sferik")
453
- expect(a_get("/1.1/users/show.json").with(:query => {:screen_name => "sferik"})).to have_been_made
451
+ it 'requests the correct resource' do
452
+ @client.user('sferik')
453
+ expect(a_get('/1.1/users/show.json').with(:query => {:screen_name => 'sferik'})).to have_been_made
454
454
  end
455
- it "returns extended information of a given user" do
456
- user = @client.user("sferik")
455
+ it 'returns extended information of a given user' do
456
+ user = @client.user('sferik')
457
457
  expect(user).to be_a Twitter::User
458
- expect(user.id).to eq(7505382)
458
+ expect(user.id).to eq(7_505_382)
459
459
  end
460
460
  end
461
- context "with a screen name including '@' passed" do
461
+ context 'with a screen name including "@" passed' do
462
462
  before do
463
- stub_get("/1.1/users/show.json").with(:query => {:screen_name => "@sferik"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
463
+ stub_get('/1.1/users/show.json').with(:query => {:screen_name => '@sferik'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
464
464
  end
465
- it "requests the correct resource" do
466
- @client.user("@sferik")
467
- expect(a_get("/1.1/users/show.json").with(:query => {:screen_name => "@sferik"})).to have_been_made
465
+ it 'requests the correct resource' do
466
+ @client.user('@sferik')
467
+ expect(a_get('/1.1/users/show.json').with(:query => {:screen_name => '@sferik'})).to have_been_made
468
468
  end
469
469
  end
470
- context "with a numeric screen name passed" do
470
+ context 'with a numeric screen name passed' do
471
471
  before do
472
- stub_get("/1.1/users/show.json").with(:query => {:screen_name => "0"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
472
+ stub_get('/1.1/users/show.json').with(:query => {:screen_name => '0'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
473
473
  end
474
- it "requests the correct resource" do
475
- @client.user("0")
476
- expect(a_get("/1.1/users/show.json").with(:query => {:screen_name => "0"})).to have_been_made
474
+ it 'requests the correct resource' do
475
+ @client.user('0')
476
+ expect(a_get('/1.1/users/show.json').with(:query => {:screen_name => '0'})).to have_been_made
477
477
  end
478
478
  end
479
- context "with a user ID passed" do
479
+ context 'with a user ID passed' do
480
480
  before do
481
- stub_get("/1.1/users/show.json").with(:query => {:user_id => "7505382"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
481
+ stub_get('/1.1/users/show.json').with(:query => {:user_id => '7505382'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
482
482
  end
483
- it "requests the correct resource" do
484
- @client.user(7505382)
485
- expect(a_get("/1.1/users/show.json").with(:query => {:user_id => "7505382"})).to have_been_made
483
+ it 'requests the correct resource' do
484
+ @client.user(7_505_382)
485
+ expect(a_get('/1.1/users/show.json').with(:query => {:user_id => '7505382'})).to have_been_made
486
486
  end
487
487
  end
488
- context "with a user object passed" do
488
+ context 'with a user object passed' do
489
489
  before do
490
- stub_get("/1.1/users/show.json").with(:query => {:user_id => "7505382"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
490
+ stub_get('/1.1/users/show.json').with(:query => {:user_id => '7505382'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
491
491
  end
492
- it "requests the correct resource" do
493
- user = Twitter::User.new(:id => 7505382)
492
+ it 'requests the correct resource' do
493
+ user = Twitter::User.new(:id => 7_505_382)
494
494
  @client.user(user)
495
- expect(a_get("/1.1/users/show.json").with(:query => {:user_id => "7505382"})).to have_been_made
495
+ expect(a_get('/1.1/users/show.json').with(:query => {:user_id => '7505382'})).to have_been_made
496
496
  end
497
497
  end
498
498
  end
499
- context "without a screen name or user ID passed" do
500
- context "without options passed" do
499
+ context 'without a screen name or user ID passed' do
500
+ context 'without options passed' do
501
501
  before do
502
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
502
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
503
503
  end
504
- it "requests the correct resource" do
504
+ it 'requests the correct resource' do
505
505
  @client.user
506
- expect(a_get("/1.1/account/verify_credentials.json")).to have_been_made
506
+ expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
507
507
  end
508
508
  end
509
- context "with options passed" do
509
+ context 'with options passed' do
510
510
  before do
511
- stub_get("/1.1/account/verify_credentials.json").with(:query => {:skip_status => "true"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
511
+ stub_get('/1.1/account/verify_credentials.json').with(:query => {:skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
512
512
  end
513
- it "requests the correct resource" do
513
+ it 'requests the correct resource' do
514
514
  @client.user(:skip_status => true)
515
- expect(a_get("/1.1/account/verify_credentials.json").with(:query => {:skip_status => "true"})).to have_been_made
515
+ expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:skip_status => 'true'})).to have_been_made
516
516
  end
517
517
  end
518
518
  end
519
519
 
520
- describe "#user?" do
520
+ describe '#user?' do
521
521
  before do
522
- stub_get("/1.1/users/show.json").with(:query => {:screen_name => "sferik"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
523
- stub_get("/1.1/users/show.json").with(:query => {:screen_name => "pengwynn"}).to_return(:body => fixture("not_found.json"), :status => 404, :headers => {:content_type => "application/json; charset=utf-8"})
522
+ stub_get('/1.1/users/show.json').with(:query => {:screen_name => 'sferik'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
523
+ stub_get('/1.1/users/show.json').with(:query => {:screen_name => 'pengwynn'}).to_return(:body => fixture('not_found.json'), :status => 404, :headers => {:content_type => 'application/json; charset=utf-8'})
524
524
  end
525
- it "requests the correct resource" do
526
- @client.user?("sferik")
527
- expect(a_get("/1.1/users/show.json").with(:query => {:screen_name => "sferik"})).to have_been_made
525
+ it 'requests the correct resource' do
526
+ @client.user?('sferik')
527
+ expect(a_get('/1.1/users/show.json').with(:query => {:screen_name => 'sferik'})).to have_been_made
528
528
  end
529
- it "returns true if user exists" do
530
- user = @client.user?("sferik")
529
+ it 'returns true if user exists' do
530
+ user = @client.user?('sferik')
531
531
  expect(user).to be true
532
532
  end
533
- it "returns false if user does not exist" do
534
- user = @client.user?("pengwynn")
533
+ it 'returns false if user does not exist' do
534
+ user = @client.user?('pengwynn')
535
535
  expect(user).to be false
536
536
  end
537
537
  end
538
538
 
539
- describe "#user_search" do
539
+ describe '#user_search' do
540
540
  before do
541
- stub_get("/1.1/users/search.json").with(:query => {:q => "Erik Michaels-Ober"}).to_return(:body => fixture("user_search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
541
+ stub_get('/1.1/users/search.json').with(:query => {:q => 'Erik Michaels-Ober'}).to_return(:body => fixture('user_search.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
542
542
  end
543
- it "requests the correct resource" do
544
- @client.user_search("Erik Michaels-Ober")
545
- expect(a_get("/1.1/users/search.json").with(:query => {:q => "Erik Michaels-Ober"})).to have_been_made
543
+ it 'requests the correct resource' do
544
+ @client.user_search('Erik Michaels-Ober')
545
+ expect(a_get('/1.1/users/search.json').with(:query => {:q => 'Erik Michaels-Ober'})).to have_been_made
546
546
  end
547
- it "returns an array of user search results" do
548
- user_search = @client.user_search("Erik Michaels-Ober")
547
+ it 'returns an array of user search results' do
548
+ user_search = @client.user_search('Erik Michaels-Ober')
549
549
  expect(user_search).to be_an Array
550
550
  expect(user_search.first).to be_a Twitter::User
551
- expect(user_search.first.id).to eq(7505382)
551
+ expect(user_search.first.id).to eq(7_505_382)
552
552
  end
553
553
  end
554
554
 
555
- describe "#contributees" do
556
- context "with a screen name passed" do
555
+ describe '#contributees' do
556
+ context 'with a screen name passed' do
557
557
  before do
558
- stub_get("/1.1/users/contributees.json").with(:query => {:screen_name => "sferik"}).to_return(:body => fixture("contributees.json"), :headers => {:content_type => "application/json; charset=utf-8"})
558
+ stub_get('/1.1/users/contributees.json').with(:query => {:screen_name => 'sferik'}).to_return(:body => fixture('contributees.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
559
559
  end
560
- it "requests the correct resource" do
561
- @client.contributees("sferik")
562
- expect(a_get("/1.1/users/contributees.json").with(:query => {:screen_name => "sferik"})).to have_been_made
560
+ it 'requests the correct resource' do
561
+ @client.contributees('sferik')
562
+ expect(a_get('/1.1/users/contributees.json').with(:query => {:screen_name => 'sferik'})).to have_been_made
563
563
  end
564
- it "returns a user's contributees" do
565
- contributees = @client.contributees("sferik")
564
+ it 'returns contributees' do
565
+ contributees = @client.contributees('sferik')
566
566
  expect(contributees).to be_an Array
567
567
  expect(contributees.first).to be_a Twitter::User
568
- expect(contributees.first.name).to eq("Twitter API")
568
+ expect(contributees.first.name).to eq('Twitter API')
569
569
  end
570
570
  end
571
- context "with a user ID passed" do
571
+ context 'with a user ID passed' do
572
572
  before do
573
- stub_get("/1.1/users/contributees.json").with(:query => {:user_id => "7505382"}).to_return(:body => fixture("contributees.json"), :headers => {:content_type => "application/json; charset=utf-8"})
573
+ stub_get('/1.1/users/contributees.json').with(:query => {:user_id => '7505382'}).to_return(:body => fixture('contributees.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
574
574
  end
575
- it "requests the correct resource" do
576
- @client.contributees(7505382)
577
- expect(a_get("/1.1/users/contributees.json").with(:query => {:user_id => "7505382"})).to have_been_made
575
+ it 'requests the correct resource' do
576
+ @client.contributees(7_505_382)
577
+ expect(a_get('/1.1/users/contributees.json').with(:query => {:user_id => '7505382'})).to have_been_made
578
578
  end
579
579
  end
580
- context "without arguments passed" do
580
+ context 'without arguments passed' do
581
581
  before do
582
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
583
- stub_get("/1.1/users/contributees.json").with(:query => {:screen_name => "sferik"}).to_return(:body => fixture("contributees.json"), :headers => {:content_type => "application/json; charset=utf-8"})
582
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
583
+ stub_get('/1.1/users/contributees.json').with(:query => {:screen_name => 'sferik'}).to_return(:body => fixture('contributees.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
584
584
  end
585
- it "requests the correct resource" do
585
+ it 'requests the correct resource' do
586
586
  @client.contributees
587
- expect(a_get("/1.1/users/contributees.json").with(:query => {:screen_name => "sferik"})).to have_been_made
587
+ expect(a_get('/1.1/users/contributees.json').with(:query => {:screen_name => 'sferik'})).to have_been_made
588
588
  end
589
- it "returns a user's contributees" do
589
+ it 'returns contributees' do
590
590
  contributees = @client.contributees
591
591
  expect(contributees).to be_an Array
592
592
  expect(contributees.first).to be_a Twitter::User
593
- expect(contributees.first.name).to eq("Twitter API")
593
+ expect(contributees.first.name).to eq('Twitter API')
594
594
  end
595
595
  end
596
596
  end
597
597
 
598
- describe "#contributors" do
599
- context "with a screen name passed" do
598
+ describe '#contributors' do
599
+ context 'with a screen name passed' do
600
600
  before do
601
- stub_get("/1.1/users/contributors.json").with(:query => {:screen_name => "sferik"}).to_return(:body => fixture("members.json"), :headers => {:content_type => "application/json; charset=utf-8"})
601
+ stub_get('/1.1/users/contributors.json').with(:query => {:screen_name => 'sferik'}).to_return(:body => fixture('members.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
602
602
  end
603
- it "requests the correct resource" do
604
- @client.contributors("sferik")
605
- expect(a_get("/1.1/users/contributors.json").with(:query => {:screen_name => "sferik"})).to have_been_made
603
+ it 'requests the correct resource' do
604
+ @client.contributors('sferik')
605
+ expect(a_get('/1.1/users/contributors.json').with(:query => {:screen_name => 'sferik'})).to have_been_made
606
606
  end
607
- it "returns a user's contributors" do
608
- contributors = @client.contributors("sferik")
607
+ it 'returns contributors' do
608
+ contributors = @client.contributors('sferik')
609
609
  expect(contributors).to be_an Array
610
610
  expect(contributors.first).to be_a Twitter::User
611
611
  expect(contributors.first.id).to eq(13)
612
612
  end
613
613
  end
614
- context "with a user ID passed" do
614
+ context 'with a user ID passed' do
615
615
  before do
616
- stub_get("/1.1/users/contributors.json").with(:query => {:user_id => "7505382"}).to_return(:body => fixture("members.json"), :headers => {:content_type => "application/json; charset=utf-8"})
616
+ stub_get('/1.1/users/contributors.json').with(:query => {:user_id => '7505382'}).to_return(:body => fixture('members.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
617
617
  end
618
- it "requests the correct resource" do
619
- @client.contributors(7505382)
620
- expect(a_get("/1.1/users/contributors.json").with(:query => {:user_id => "7505382"})).to have_been_made
618
+ it 'requests the correct resource' do
619
+ @client.contributors(7_505_382)
620
+ expect(a_get('/1.1/users/contributors.json').with(:query => {:user_id => '7505382'})).to have_been_made
621
621
  end
622
622
  end
623
- context "without arguments passed" do
623
+ context 'without arguments passed' do
624
624
  before do
625
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
626
- stub_get("/1.1/users/contributors.json").with(:query => {:screen_name => "sferik"}).to_return(:body => fixture("members.json"), :headers => {:content_type => "application/json; charset=utf-8"})
625
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
626
+ stub_get('/1.1/users/contributors.json').with(:query => {:screen_name => 'sferik'}).to_return(:body => fixture('members.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
627
627
  end
628
- it "requests the correct resource" do
628
+ it 'requests the correct resource' do
629
629
  @client.contributors
630
- expect(a_get("/1.1/users/contributors.json").with(:query => {:screen_name => "sferik"})).to have_been_made
630
+ expect(a_get('/1.1/users/contributors.json').with(:query => {:screen_name => 'sferik'})).to have_been_made
631
631
  end
632
- it "returns a user's contributors" do
632
+ it 'returns contributors' do
633
633
  contributors = @client.contributors
634
634
  expect(contributors).to be_an Array
635
635
  expect(contributors.first).to be_a Twitter::User
@@ -638,70 +638,70 @@ describe Twitter::REST::API::Users do
638
638
  end
639
639
  end
640
640
 
641
- describe "#remove_profile_banner" do
641
+ describe '#remove_profile_banner' do
642
642
  before do
643
- stub_post("/1.1/account/remove_profile_banner.json").to_return(:body => fixture("empty.json"), :headers => {:content_type => "application/json; charset=utf-8"})
643
+ stub_post('/1.1/account/remove_profile_banner.json').to_return(:body => fixture('empty.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
644
644
  end
645
- it "requests the correct resource" do
645
+ it 'requests the correct resource' do
646
646
  @client.remove_profile_banner
647
- expect(a_post("/1.1/account/remove_profile_banner.json")).to have_been_made
647
+ expect(a_post('/1.1/account/remove_profile_banner.json')).to have_been_made
648
648
  end
649
- it "returns a user" do
649
+ it 'returns a user' do
650
650
  user = @client.remove_profile_banner
651
651
  expect(user).to be_nil
652
652
  end
653
653
  end
654
654
 
655
- describe "#update_profile_banner" do
655
+ describe '#update_profile_banner' do
656
656
  before do
657
- stub_post("/1.1/account/update_profile_banner.json").to_return(:body => fixture("empty.json"), :headers => {:content_type => "application/json; charset=utf-8"})
657
+ stub_post('/1.1/account/update_profile_banner.json').to_return(:body => fixture('empty.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
658
658
  end
659
- it "requests the correct resource" do
660
- @client.update_profile_banner(fixture("me.jpeg"))
661
- expect(a_post("/1.1/account/update_profile_banner.json")).to have_been_made
659
+ it 'requests the correct resource' do
660
+ @client.update_profile_banner(fixture('me.jpeg'))
661
+ expect(a_post('/1.1/account/update_profile_banner.json')).to have_been_made
662
662
  end
663
- it "returns a user" do
664
- user = @client.update_profile_banner(fixture("me.jpeg"))
663
+ it 'returns a user' do
664
+ user = @client.update_profile_banner(fixture('me.jpeg'))
665
665
  expect(user).to be_nil
666
666
  end
667
667
  end
668
668
 
669
- describe "#profile_banner" do
670
- context "with a screen_name passed" do
669
+ describe '#profile_banner' do
670
+ context 'with a screen_name passed' do
671
671
  before do
672
- stub_get("/1.1/users/profile_banner.json").with(:query => {:screen_name => "sferik"}).to_return(:body => fixture("profile_banner.json"), :headers => {:content_type => "application/json; charset=utf-8"})
672
+ stub_get('/1.1/users/profile_banner.json').with(:query => {:screen_name => 'sferik'}).to_return(:body => fixture('profile_banner.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
673
673
  end
674
- it "requests the correct resource" do
675
- @client.profile_banner("sferik")
676
- expect(a_get("/1.1/users/profile_banner.json").with(:query => {:screen_name => "sferik"})).to have_been_made
674
+ it 'requests the correct resource' do
675
+ @client.profile_banner('sferik')
676
+ expect(a_get('/1.1/users/profile_banner.json').with(:query => {:screen_name => 'sferik'})).to have_been_made
677
677
  end
678
- it "returns a user's profile banner" do
679
- banner = @client.profile_banner("sferik")
678
+ it 'returns a profile banner' do
679
+ banner = @client.profile_banner('sferik')
680
680
  expect(banner).to be_a Twitter::ProfileBanner
681
681
  expect(banner.sizes).to be_a Hash
682
682
  expect(banner.sizes[:mobile].height).to eq(160)
683
683
  end
684
684
  end
685
- context "with a user ID passed" do
685
+ context 'with a user ID passed' do
686
686
  before do
687
- stub_get("/1.1/users/profile_banner.json").with(:query => {:user_id => "7505382"}).to_return(:body => fixture("profile_banner.json"), :headers => {:content_type => "application/json; charset=utf-8"})
687
+ stub_get('/1.1/users/profile_banner.json').with(:query => {:user_id => '7505382'}).to_return(:body => fixture('profile_banner.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
688
688
  end
689
- it "requests the correct resource" do
690
- @client.profile_banner(7505382)
691
- expect(a_get("/1.1/users/profile_banner.json").with(:query => {:user_id => "7505382"})).to have_been_made
689
+ it 'requests the correct resource' do
690
+ @client.profile_banner(7_505_382)
691
+ expect(a_get('/1.1/users/profile_banner.json').with(:query => {:user_id => '7505382'})).to have_been_made
692
692
  end
693
693
  end
694
- context "without arguments passed" do
694
+ context 'without arguments passed' do
695
695
  before do
696
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
697
- stub_get("/1.1/users/profile_banner.json").with(:query => {:screen_name => "sferik"}).to_return(:body => fixture("profile_banner.json"), :headers => {:content_type => "application/json; charset=utf-8"})
696
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
697
+ stub_get('/1.1/users/profile_banner.json').with(:query => {:screen_name => 'sferik'}).to_return(:body => fixture('profile_banner.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
698
698
  end
699
- it "requests the correct resource" do
699
+ it 'requests the correct resource' do
700
700
  @client.profile_banner
701
- expect(a_get("/1.1/account/verify_credentials.json")).to have_been_made
702
- expect(a_get("/1.1/users/profile_banner.json").with(:query => {:screen_name => "sferik"})).to have_been_made
701
+ expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
702
+ expect(a_get('/1.1/users/profile_banner.json').with(:query => {:screen_name => 'sferik'})).to have_been_made
703
703
  end
704
- it "returns an array of numeric IDs for every user following the specified user" do
704
+ it 'returns an array of numeric IDs for every user following the specified user' do
705
705
  banner = @client.profile_banner
706
706
  expect(banner).to be_a Twitter::ProfileBanner
707
707
  expect(banner.sizes).to be_a Hash