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,653 +3,653 @@ require 'helper'
3
3
  describe Twitter::REST::API::FriendsAndFollowers 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 "#friend_ids" do
10
- context "with a screen name passed" do
9
+ describe '#friend_ids' do
10
+ context 'with a screen name passed' do
11
11
  before do
12
- stub_get("/1.1/friends/ids.json").with(:query => {:cursor => "-1", :screen_name => "sferik"}).to_return(:body => fixture("ids_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
12
+ stub_get('/1.1/friends/ids.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'}).to_return(:body => fixture('ids_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
13
13
  end
14
- it "requests the correct resource" do
15
- @client.friend_ids("sferik")
16
- expect(a_get("/1.1/friends/ids.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
14
+ it 'requests the correct resource' do
15
+ @client.friend_ids('sferik')
16
+ expect(a_get('/1.1/friends/ids.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 the specified user is following" do
19
- friend_ids = @client.friend_ids("sferik")
18
+ it 'returns an array of numeric IDs for every user the specified user is following' do
19
+ friend_ids = @client.friend_ids('sferik')
20
20
  expect(friend_ids).to be_a Twitter::Cursor
21
- expect(friend_ids.first).to eq(20009713)
21
+ expect(friend_ids.first).to eq(20_009_713)
22
22
  end
23
- context "with each" do
23
+ context 'with each' do
24
24
  before do
25
- stub_get("/1.1/friends/ids.json").with(:query => {:cursor => "1305102810874389703", :screen_name => "sferik"}).to_return(:body => fixture("ids_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
25
+ stub_get('/1.1/friends/ids.json').with(:query => {:cursor => '1305102810874389703', :screen_name => 'sferik'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
26
26
  end
27
- it "requests the correct resource" do
28
- @client.friend_ids("sferik").each{}
29
- expect(a_get("/1.1/friends/ids.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
30
- expect(a_get("/1.1/friends/ids.json").with(:query => {:cursor => "1305102810874389703", :screen_name => "sferik"})).to have_been_made
27
+ it 'requests the correct resource' do
28
+ @client.friend_ids('sferik').each {}
29
+ expect(a_get('/1.1/friends/ids.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
30
+ expect(a_get('/1.1/friends/ids.json').with(:query => {:cursor => '1305102810874389703', :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("/1.1/friends/ids.json").with(:query => {:cursor => "-1", :user_id => "7505382"}).to_return(:body => fixture("ids_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
36
+ stub_get('/1.1/friends/ids.json').with(:query => {:cursor => '-1', :user_id => '7505382'}).to_return(:body => fixture('ids_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
37
37
  end
38
- it "requests the correct resource" do
39
- @client.friend_ids(7505382)
40
- expect(a_get("/1.1/friends/ids.json").with(:query => {:cursor => "-1", :user_id => "7505382"})).to have_been_made
38
+ it 'requests the correct resource' do
39
+ @client.friend_ids(7_505_382)
40
+ expect(a_get('/1.1/friends/ids.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("/1.1/friends/ids.json").with(:query => {:cursor => "1305102810874389703", :user_id => "7505382"}).to_return(:body => fixture("ids_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
44
+ stub_get('/1.1/friends/ids.json').with(:query => {:cursor => '1305102810874389703', :user_id => '7505382'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
45
45
  end
46
- it "requests the correct resource" do
47
- @client.friend_ids(7505382).each{}
48
- expect(a_get("/1.1/friends/ids.json").with(:query => {:cursor => "-1", :user_id => "7505382"})).to have_been_made
49
- expect(a_get("/1.1/friends/ids.json").with(:query => {:cursor => "1305102810874389703", :user_id => "7505382"})).to have_been_made
46
+ it 'requests the correct resource' do
47
+ @client.friend_ids(7_505_382).each {}
48
+ expect(a_get('/1.1/friends/ids.json').with(:query => {:cursor => '-1', :user_id => '7505382'})).to have_been_made
49
+ expect(a_get('/1.1/friends/ids.json').with(:query => {:cursor => '1305102810874389703', :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("/1.1/friends/ids.json").with(:query => {:cursor => "-1", :screen_name => "sferik"}).to_return(:body => fixture("ids_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('/1.1/friends/ids.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'}).to_return(:body => fixture('ids_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.friend_ids
60
- expect(a_get("/1.1/account/verify_credentials.json")).to have_been_made
61
- expect(a_get("/1.1/friends/ids.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('/1.1/friends/ids.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 the specified user is following" do
63
+ it 'returns an array of numeric IDs for every user the specified user is following' do
64
64
  friend_ids = @client.friend_ids
65
65
  expect(friend_ids).to be_a Twitter::Cursor
66
- expect(friend_ids.first).to eq(20009713)
66
+ expect(friend_ids.first).to eq(20_009_713)
67
67
  end
68
- context "with each" do
68
+ context 'with each' do
69
69
  before do
70
- stub_get("/1.1/friends/ids.json").with(:query => {:cursor => "1305102810874389703", :screen_name => "sferik"}).to_return(:body => fixture("ids_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
70
+ stub_get('/1.1/friends/ids.json').with(:query => {:cursor => '1305102810874389703', :screen_name => 'sferik'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
71
71
  end
72
- it "requests the correct resource" do
73
- @client.friend_ids.each{}
74
- expect(a_get("/1.1/account/verify_credentials.json")).to have_been_made
75
- expect(a_get("/1.1/friends/ids.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
76
- expect(a_get("/1.1/friends/ids.json").with(:query => {:cursor => "1305102810874389703", :screen_name => "sferik"})).to have_been_made
72
+ it 'requests the correct resource' do
73
+ @client.friend_ids.each {}
74
+ expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
75
+ expect(a_get('/1.1/friends/ids.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
76
+ expect(a_get('/1.1/friends/ids.json').with(:query => {:cursor => '1305102810874389703', :screen_name => 'sferik'})).to have_been_made
77
77
  end
78
78
  end
79
79
  end
80
80
  end
81
81
 
82
- describe "#follower_ids" do
83
- context "with a screen name passed" do
82
+ describe '#follower_ids' do
83
+ context 'with a screen name passed' do
84
84
  before do
85
- stub_get("/1.1/followers/ids.json").with(:query => {:cursor => "-1", :screen_name => "sferik"}).to_return(:body => fixture("ids_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
85
+ stub_get('/1.1/followers/ids.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'}).to_return(:body => fixture('ids_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
86
86
  end
87
- it "requests the correct resource" do
88
- @client.follower_ids("sferik")
89
- expect(a_get("/1.1/followers/ids.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
87
+ it 'requests the correct resource' do
88
+ @client.follower_ids('sferik')
89
+ expect(a_get('/1.1/followers/ids.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
90
90
  end
91
- it "returns an array of numeric IDs for every user following the specified user" do
92
- follower_ids = @client.follower_ids("sferik")
91
+ it 'returns an array of numeric IDs for every user following the specified user' do
92
+ follower_ids = @client.follower_ids('sferik')
93
93
  expect(follower_ids).to be_a Twitter::Cursor
94
- expect(follower_ids.first).to eq(20009713)
94
+ expect(follower_ids.first).to eq(20_009_713)
95
95
  end
96
- context "with each" do
96
+ context 'with each' do
97
97
  before do
98
- stub_get("/1.1/followers/ids.json").with(:query => {:cursor => "1305102810874389703", :screen_name => "sferik"}).to_return(:body => fixture("ids_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
98
+ stub_get('/1.1/followers/ids.json').with(:query => {:cursor => '1305102810874389703', :screen_name => 'sferik'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
99
99
  end
100
- it "requests the correct resource" do
101
- @client.follower_ids("sferik").each{}
102
- expect(a_get("/1.1/followers/ids.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
103
- expect(a_get("/1.1/followers/ids.json").with(:query => {:cursor => "1305102810874389703", :screen_name => "sferik"})).to have_been_made
100
+ it 'requests the correct resource' do
101
+ @client.follower_ids('sferik').each {}
102
+ expect(a_get('/1.1/followers/ids.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
103
+ expect(a_get('/1.1/followers/ids.json').with(:query => {:cursor => '1305102810874389703', :screen_name => 'sferik'})).to have_been_made
104
104
  end
105
105
  end
106
106
  end
107
- context "with a user ID passed" do
107
+ context 'with a user ID passed' do
108
108
  before do
109
- stub_get("/1.1/followers/ids.json").with(:query => {:cursor => "-1", :user_id => "7505382"}).to_return(:body => fixture("ids_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
109
+ stub_get('/1.1/followers/ids.json').with(:query => {:cursor => '-1', :user_id => '7505382'}).to_return(:body => fixture('ids_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
110
110
  end
111
- it "requests the correct resource" do
112
- @client.follower_ids(7505382)
113
- expect(a_get("/1.1/followers/ids.json").with(:query => {:cursor => "-1", :user_id => "7505382"})).to have_been_made
111
+ it 'requests the correct resource' do
112
+ @client.follower_ids(7_505_382)
113
+ expect(a_get('/1.1/followers/ids.json').with(:query => {:cursor => '-1', :user_id => '7505382'})).to have_been_made
114
114
  end
115
- context "with each" do
115
+ context 'with each' do
116
116
  before do
117
- stub_get("/1.1/followers/ids.json").with(:query => {:cursor => "1305102810874389703", :user_id => "7505382"}).to_return(:body => fixture("ids_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
117
+ stub_get('/1.1/followers/ids.json').with(:query => {:cursor => '1305102810874389703', :user_id => '7505382'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
118
118
  end
119
- it "requests the correct resource" do
120
- @client.follower_ids(7505382).each{}
121
- expect(a_get("/1.1/followers/ids.json").with(:query => {:cursor => "-1", :user_id => "7505382"})).to have_been_made
122
- expect(a_get("/1.1/followers/ids.json").with(:query => {:cursor => "1305102810874389703", :user_id => "7505382"})).to have_been_made
119
+ it 'requests the correct resource' do
120
+ @client.follower_ids(7_505_382).each {}
121
+ expect(a_get('/1.1/followers/ids.json').with(:query => {:cursor => '-1', :user_id => '7505382'})).to have_been_made
122
+ expect(a_get('/1.1/followers/ids.json').with(:query => {:cursor => '1305102810874389703', :user_id => '7505382'})).to have_been_made
123
123
  end
124
124
  end
125
125
  end
126
- context "without arguments passed" do
126
+ context 'without arguments passed' do
127
127
  before do
128
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
129
- stub_get("/1.1/followers/ids.json").with(:query => {:cursor => "-1", :screen_name => "sferik"}).to_return(:body => fixture("ids_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
128
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
129
+ stub_get('/1.1/followers/ids.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'}).to_return(:body => fixture('ids_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
130
130
  end
131
- it "requests the correct resource" do
131
+ it 'requests the correct resource' do
132
132
  @client.follower_ids
133
- expect(a_get("/1.1/account/verify_credentials.json")).to have_been_made
134
- expect(a_get("/1.1/followers/ids.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
133
+ expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
134
+ expect(a_get('/1.1/followers/ids.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
135
135
  end
136
- it "returns an array of numeric IDs for every user following the specified user" do
136
+ it 'returns an array of numeric IDs for every user following the specified user' do
137
137
  follower_ids = @client.follower_ids
138
138
  expect(follower_ids).to be_a Twitter::Cursor
139
- expect(follower_ids.first).to eq(20009713)
139
+ expect(follower_ids.first).to eq(20_009_713)
140
140
  end
141
- context "with each" do
141
+ context 'with each' do
142
142
  before do
143
- stub_get("/1.1/followers/ids.json").with(:query => {:cursor => "1305102810874389703", :screen_name => "sferik"}).to_return(:body => fixture("ids_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
143
+ stub_get('/1.1/followers/ids.json').with(:query => {:cursor => '1305102810874389703', :screen_name => 'sferik'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
144
144
  end
145
- it "requests the correct resource" do
146
- @client.follower_ids.each{}
147
- expect(a_get("/1.1/account/verify_credentials.json")).to have_been_made
148
- expect(a_get("/1.1/followers/ids.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
149
- expect(a_get("/1.1/followers/ids.json").with(:query => {:cursor => "1305102810874389703", :screen_name => "sferik"})).to have_been_made
145
+ it 'requests the correct resource' do
146
+ @client.follower_ids.each {}
147
+ expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
148
+ expect(a_get('/1.1/followers/ids.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
149
+ expect(a_get('/1.1/followers/ids.json').with(:query => {:cursor => '1305102810874389703', :screen_name => 'sferik'})).to have_been_made
150
150
  end
151
151
  end
152
152
  end
153
153
  end
154
154
 
155
- describe "#friendships" do
156
- context "with screen names passed" do
155
+ describe '#friendships' do
156
+ context 'with screen names passed' do
157
157
  before do
158
- stub_get("/1.1/friendships/lookup.json").with(:query => {:screen_name => "sferik,pengwynn"}).to_return(:body => fixture("friendships.json"), :headers => {:content_type => "application/json; charset=utf-8"})
158
+ stub_get('/1.1/friendships/lookup.json').with(:query => {:screen_name => 'sferik,pengwynn'}).to_return(:body => fixture('friendships.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
159
159
  end
160
- it "requests the correct resource" do
161
- @client.friendships("sferik", "pengwynn")
162
- expect(a_get("/1.1/friendships/lookup.json").with(:query => {:screen_name => "sferik,pengwynn"})).to have_been_made
160
+ it 'requests the correct resource' do
161
+ @client.friendships('sferik', 'pengwynn')
162
+ expect(a_get('/1.1/friendships/lookup.json').with(:query => {:screen_name => 'sferik,pengwynn'})).to have_been_made
163
163
  end
164
- it "returns up to 100 users worth of extended information" do
165
- friendships = @client.friendships("sferik", "pengwynn")
164
+ it 'returns up to 100 users worth of extended information' do
165
+ friendships = @client.friendships('sferik', 'pengwynn')
166
166
  expect(friendships).to be_an Array
167
167
  expect(friendships.first).to be_a Twitter::User
168
- expect(friendships.first.id).to eq(7505382)
169
- expect(friendships.first.connections).to eq(["none"])
168
+ expect(friendships.first.id).to eq(7_505_382)
169
+ expect(friendships.first.connections).to eq(['none'])
170
170
  end
171
171
  end
172
- context "with numeric screen names passed" do
172
+ context 'with numeric screen names passed' do
173
173
  before do
174
- stub_get("/1.1/friendships/lookup.json").with(:query => {:screen_name => "0,311"}).to_return(:body => fixture("friendships.json"), :headers => {:content_type => "application/json; charset=utf-8"})
174
+ stub_get('/1.1/friendships/lookup.json').with(:query => {:screen_name => '0,311'}).to_return(:body => fixture('friendships.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
175
175
  end
176
- it "requests the correct resource" do
177
- @client.friendships("0", "311")
178
- expect(a_get("/1.1/friendships/lookup.json").with(:query => {:screen_name => "0,311"})).to have_been_made
176
+ it 'requests the correct resource' do
177
+ @client.friendships('0', '311')
178
+ expect(a_get('/1.1/friendships/lookup.json').with(:query => {:screen_name => '0,311'})).to have_been_made
179
179
  end
180
180
  end
181
- context "with user IDs passed" do
181
+ context 'with user IDs passed' do
182
182
  before do
183
- stub_get("/1.1/friendships/lookup.json").with(:query => {:user_id => "7505382,14100886"}).to_return(:body => fixture("friendships.json"), :headers => {:content_type => "application/json; charset=utf-8"})
183
+ stub_get('/1.1/friendships/lookup.json').with(:query => {:user_id => '7505382,14100886'}).to_return(:body => fixture('friendships.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
184
184
  end
185
- it "requests the correct resource" do
186
- @client.friendships(7505382, 14100886)
187
- expect(a_get("/1.1/friendships/lookup.json").with(:query => {:user_id => "7505382,14100886"})).to have_been_made
185
+ it 'requests the correct resource' do
186
+ @client.friendships(7_505_382, 14_100_886)
187
+ expect(a_get('/1.1/friendships/lookup.json').with(:query => {:user_id => '7505382,14100886'})).to have_been_made
188
188
  end
189
189
  end
190
- context "with both screen names and user IDs passed" do
190
+ context 'with both screen names and user IDs passed' do
191
191
  before do
192
- stub_get("/1.1/friendships/lookup.json").with(:query => {:screen_name => "sferik", :user_id => "14100886"}).to_return(:body => fixture("friendships.json"), :headers => {:content_type => "application/json; charset=utf-8"})
192
+ stub_get('/1.1/friendships/lookup.json').with(:query => {:screen_name => 'sferik', :user_id => '14100886'}).to_return(:body => fixture('friendships.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
193
193
  end
194
- it "requests the correct resource" do
195
- @client.friendships("sferik", 14100886)
196
- expect(a_get("/1.1/friendships/lookup.json").with(:query => {:screen_name => "sferik", :user_id => "14100886"})).to have_been_made
194
+ it 'requests the correct resource' do
195
+ @client.friendships('sferik', 14_100_886)
196
+ expect(a_get('/1.1/friendships/lookup.json').with(:query => {:screen_name => 'sferik', :user_id => '14100886'})).to have_been_made
197
197
  end
198
198
  end
199
199
  end
200
200
 
201
- describe "#friendships" do
202
- context "with screen names passed" do
201
+ describe '#friendships' do
202
+ context 'with screen names passed' do
203
203
  before do
204
- stub_get("/1.1/friendships/lookup.json").with(:query => {:screen_name => "sferik,pengwynn"}).to_return(:body => fixture("friendships.json"), :headers => {:content_type => "application/json; charset=utf-8"})
204
+ stub_get('/1.1/friendships/lookup.json').with(:query => {:screen_name => 'sferik,pengwynn'}).to_return(:body => fixture('friendships.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
205
205
  end
206
- it "requests the correct resource" do
207
- @client.friendships("sferik", "pengwynn")
208
- expect(a_get("/1.1/friendships/lookup.json").with(:query => {:screen_name => "sferik,pengwynn"})).to have_been_made
206
+ it 'requests the correct resource' do
207
+ @client.friendships('sferik', 'pengwynn')
208
+ expect(a_get('/1.1/friendships/lookup.json').with(:query => {:screen_name => 'sferik,pengwynn'})).to have_been_made
209
209
  end
210
- it "returns up to 100 users worth of extended information" do
211
- friendships = @client.friendships("sferik", "pengwynn")
210
+ it 'returns up to 100 users worth of extended information' do
211
+ friendships = @client.friendships('sferik', 'pengwynn')
212
212
  expect(friendships).to be_an Array
213
213
  expect(friendships.first).to be_a Twitter::User
214
- expect(friendships.first.id).to eq(7505382)
215
- expect(friendships.first.connections).to eq(["none"])
214
+ expect(friendships.first.id).to eq(7_505_382)
215
+ expect(friendships.first.connections).to eq(['none'])
216
216
  end
217
217
  end
218
- context "with numeric screen names passed" do
218
+ context 'with numeric screen names passed' do
219
219
  before do
220
- stub_get("/1.1/friendships/lookup.json").with(:query => {:screen_name => "0,311"}).to_return(:body => fixture("friendships.json"), :headers => {:content_type => "application/json; charset=utf-8"})
220
+ stub_get('/1.1/friendships/lookup.json').with(:query => {:screen_name => '0,311'}).to_return(:body => fixture('friendships.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
221
221
  end
222
- it "requests the correct resource" do
223
- @client.friendships("0", "311")
224
- expect(a_get("/1.1/friendships/lookup.json").with(:query => {:screen_name => "0,311"})).to have_been_made
222
+ it 'requests the correct resource' do
223
+ @client.friendships('0', '311')
224
+ expect(a_get('/1.1/friendships/lookup.json').with(:query => {:screen_name => '0,311'})).to have_been_made
225
225
  end
226
226
  end
227
- context "with user IDs passed" do
227
+ context 'with user IDs passed' do
228
228
  before do
229
- stub_get("/1.1/friendships/lookup.json").with(:query => {:user_id => "7505382,14100886"}).to_return(:body => fixture("friendships.json"), :headers => {:content_type => "application/json; charset=utf-8"})
229
+ stub_get('/1.1/friendships/lookup.json').with(:query => {:user_id => '7505382,14100886'}).to_return(:body => fixture('friendships.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
230
230
  end
231
- it "requests the correct resource" do
232
- @client.friendships(7505382, 14100886)
233
- expect(a_get("/1.1/friendships/lookup.json").with(:query => {:user_id => "7505382,14100886"})).to have_been_made
231
+ it 'requests the correct resource' do
232
+ @client.friendships(7_505_382, 14_100_886)
233
+ expect(a_get('/1.1/friendships/lookup.json').with(:query => {:user_id => '7505382,14100886'})).to have_been_made
234
234
  end
235
235
  end
236
- context "with both screen names and user IDs passed" do
236
+ context 'with both screen names and user IDs passed' do
237
237
  before do
238
- stub_get("/1.1/friendships/lookup.json").with(:query => {:screen_name => "sferik", :user_id => "14100886"}).to_return(:body => fixture("friendships.json"), :headers => {:content_type => "application/json; charset=utf-8"})
238
+ stub_get('/1.1/friendships/lookup.json').with(:query => {:screen_name => 'sferik', :user_id => '14100886'}).to_return(:body => fixture('friendships.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
239
239
  end
240
- it "requests the correct resource" do
241
- @client.friendships("sferik", 14100886)
242
- expect(a_get("/1.1/friendships/lookup.json").with(:query => {:screen_name => "sferik", :user_id => "14100886"})).to have_been_made
240
+ it 'requests the correct resource' do
241
+ @client.friendships('sferik', 14_100_886)
242
+ expect(a_get('/1.1/friendships/lookup.json').with(:query => {:screen_name => 'sferik', :user_id => '14100886'})).to have_been_made
243
243
  end
244
244
  end
245
245
  end
246
246
 
247
- describe "#friendships_incoming" do
247
+ describe '#friendships_incoming' do
248
248
  before do
249
- stub_get("/1.1/friendships/incoming.json").with(:query => {:cursor => "-1"}).to_return(:body => fixture("ids_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
249
+ stub_get('/1.1/friendships/incoming.json').with(:query => {:cursor => '-1'}).to_return(:body => fixture('ids_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
250
250
  end
251
- it "requests the correct resource" do
251
+ it 'requests the correct resource' do
252
252
  @client.friendships_incoming
253
- expect(a_get("/1.1/friendships/incoming.json").with(:query => {:cursor => "-1"})).to have_been_made
253
+ expect(a_get('/1.1/friendships/incoming.json').with(:query => {:cursor => '-1'})).to have_been_made
254
254
  end
255
- it "returns an array of numeric IDs for every user who has a pending request to follow the authenticating user" do
255
+ it 'returns an array of numeric IDs for every user who has a pending request to follow the authenticating user' do
256
256
  friendships_incoming = @client.friendships_incoming
257
257
  expect(friendships_incoming).to be_a Twitter::Cursor
258
- expect(friendships_incoming.first).to eq(20009713)
258
+ expect(friendships_incoming.first).to eq(20_009_713)
259
259
  end
260
- context "with each" do
260
+ context 'with each' do
261
261
  before do
262
- stub_get("/1.1/friendships/incoming.json").with(:query => {:cursor => "1305102810874389703"}).to_return(:body => fixture("ids_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
262
+ stub_get('/1.1/friendships/incoming.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 resource" do
265
- @client.friendships_incoming.each{}
266
- expect(a_get("/1.1/friendships/incoming.json").with(:query => {:cursor => "1305102810874389703"})).to have_been_made
264
+ it 'requests the correct resource' do
265
+ @client.friendships_incoming.each {}
266
+ expect(a_get('/1.1/friendships/incoming.json').with(:query => {:cursor => '1305102810874389703'})).to have_been_made
267
267
  end
268
268
  end
269
269
  end
270
270
 
271
- describe "#friendships_outgoing" do
271
+ describe '#friendships_outgoing' do
272
272
  before do
273
- stub_get("/1.1/friendships/outgoing.json").with(:query => {:cursor => "-1"}).to_return(:body => fixture("ids_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
273
+ stub_get('/1.1/friendships/outgoing.json').with(:query => {:cursor => '-1'}).to_return(:body => fixture('ids_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
274
274
  end
275
- it "requests the correct resource" do
275
+ it 'requests the correct resource' do
276
276
  @client.friendships_outgoing
277
- expect(a_get("/1.1/friendships/outgoing.json").with(:query => {:cursor => "-1"})).to have_been_made
277
+ expect(a_get('/1.1/friendships/outgoing.json').with(:query => {:cursor => '-1'})).to have_been_made
278
278
  end
279
- it "returns an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request" do
279
+ it 'returns an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request' do
280
280
  friendships_outgoing = @client.friendships_outgoing
281
281
  expect(friendships_outgoing).to be_a Twitter::Cursor
282
- expect(friendships_outgoing.first).to eq(20009713)
282
+ expect(friendships_outgoing.first).to eq(20_009_713)
283
283
  end
284
- context "with each" do
284
+ context 'with each' do
285
285
  before do
286
- stub_get("/1.1/friendships/outgoing.json").with(:query => {:cursor => "1305102810874389703"}).to_return(:body => fixture("ids_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
286
+ stub_get('/1.1/friendships/outgoing.json').with(:query => {:cursor => '1305102810874389703'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
287
287
  end
288
- it "requests the correct resource" do
289
- @client.friendships_outgoing.each{}
290
- expect(a_get("/1.1/friendships/outgoing.json").with(:query => {:cursor => "1305102810874389703"})).to have_been_made
288
+ it 'requests the correct resource' do
289
+ @client.friendships_outgoing.each {}
290
+ expect(a_get('/1.1/friendships/outgoing.json').with(:query => {:cursor => '1305102810874389703'})).to have_been_made
291
291
  end
292
292
  end
293
293
  end
294
294
 
295
- describe "#follow" do
295
+ describe '#follow' do
296
296
  before do
297
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
298
- stub_get("/1.1/friends/ids.json").with(:query => {:cursor => "-1", :screen_name => "sferik"}).to_return(:body => fixture("ids_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
299
- stub_post("/1.1/users/lookup.json").with(:body => {:screen_name => "sferik,pengwynn"}).to_return(:body => fixture("friendships.json"), :headers => {:content_type => "application/json; charset=utf-8"})
300
- stub_post("/1.1/friendships/create.json").with(:body => {:user_id => "7505382"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
301
- end
302
- it "requests the correct resource" do
303
- @client.follow("sferik", "pengwynn")
304
- expect(a_get("/1.1/account/verify_credentials.json")).to have_been_made
305
- expect(a_get("/1.1/friends/ids.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
306
- expect(a_post("/1.1/users/lookup.json").with(:body => {:screen_name => "sferik,pengwynn"})).to have_been_made
307
- expect(a_post("/1.1/friendships/create.json").with(:body => {:user_id => "7505382"})).to have_been_made
297
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
298
+ stub_get('/1.1/friends/ids.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
299
+ stub_post('/1.1/users/lookup.json').with(:body => {:screen_name => 'sferik,pengwynn'}).to_return(:body => fixture('friendships.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
300
+ stub_post('/1.1/friendships/create.json').with(:body => {:user_id => '7505382'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
301
+ end
302
+ it 'requests the correct resource' do
303
+ @client.follow('sferik', 'pengwynn')
304
+ expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
305
+ expect(a_get('/1.1/friends/ids.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
306
+ expect(a_post('/1.1/users/lookup.json').with(:body => {:screen_name => 'sferik,pengwynn'})).to have_been_made
307
+ expect(a_post('/1.1/friendships/create.json').with(:body => {:user_id => '7505382'})).to have_been_made
308
308
  end
309
309
  end
310
310
 
311
- describe "#follow!" do
311
+ describe '#follow!' do
312
312
  before do
313
- stub_post("/1.1/friendships/create.json").with(:body => {:screen_name => "sferik"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
313
+ stub_post('/1.1/friendships/create.json').with(:body => {:screen_name => 'sferik'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
314
314
  end
315
- it "requests the correct resource" do
316
- @client.follow!("sferik")
317
- expect(a_post("/1.1/friendships/create.json").with(:body => {:screen_name => "sferik"})).to have_been_made
315
+ it 'requests the correct resource' do
316
+ @client.follow!('sferik')
317
+ expect(a_post('/1.1/friendships/create.json').with(:body => {:screen_name => 'sferik'})).to have_been_made
318
318
  end
319
- it "returns an array of befriended users" do
320
- users = @client.follow!("sferik")
319
+ it 'returns an array of befriended users' do
320
+ users = @client.follow!('sferik')
321
321
  expect(users).to be_an Array
322
322
  expect(users.first).to be_a Twitter::User
323
- expect(users.first.id).to eq(7505382)
323
+ expect(users.first.id).to eq(7_505_382)
324
324
  end
325
325
  end
326
- context "with a user object passed" do
326
+ context 'with a user object passed' do
327
327
  before do
328
- stub_post("/1.1/friendships/create.json").with(:body => {:user_id => "7505382"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
328
+ stub_post('/1.1/friendships/create.json').with(:body => {:user_id => '7505382'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
329
329
  end
330
- it "requests the correct resources" do
331
- user = Twitter::User.new(:id => "7505382")
330
+ it 'requests the correct resources' do
331
+ user = Twitter::User.new(:id => '7505382')
332
332
  @client.follow!(user)
333
- expect(a_post("/1.1/friendships/create.json").with(:body => {:user_id => "7505382"})).to have_been_made
333
+ expect(a_post('/1.1/friendships/create.json').with(:body => {:user_id => '7505382'})).to have_been_made
334
334
  end
335
335
  end
336
- context "with a URI object passed" do
336
+ context 'with a URI object passed' do
337
337
  before do
338
- stub_post("/1.1/friendships/create.json").with(:body => {:screen_name => "sferik"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
338
+ stub_post('/1.1/friendships/create.json').with(:body => {:screen_name => 'sferik'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
339
339
  end
340
- it "requests the correct resource" do
341
- user = URI.parse("https://twitter.com/sferik")
340
+ it 'requests the correct resource' do
341
+ user = URI.parse('https://twitter.com/sferik')
342
342
  @client.follow!(user)
343
- expect(a_post("/1.1/friendships/create.json").with(:body => {:screen_name => "sferik"})).to have_been_made
343
+ expect(a_post('/1.1/friendships/create.json').with(:body => {:screen_name => 'sferik'})).to have_been_made
344
344
  end
345
345
  end
346
- context "with a URI string passed" do
346
+ context 'with a URI string passed' do
347
347
  before do
348
- stub_post("/1.1/friendships/create.json").with(:body => {:screen_name => "sferik"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
348
+ stub_post('/1.1/friendships/create.json').with(:body => {:screen_name => 'sferik'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
349
349
  end
350
- it "requests the correct resource" do
351
- @client.follow!("https://twitter.com/sferik")
352
- expect(a_post("/1.1/friendships/create.json").with(:body => {:screen_name => "sferik"})).to have_been_made
350
+ it 'requests the correct resource' do
351
+ @client.follow!('https://twitter.com/sferik')
352
+ expect(a_post('/1.1/friendships/create.json').with(:body => {:screen_name => 'sferik'})).to have_been_made
353
353
  end
354
354
  end
355
355
 
356
- describe "#unfollow" do
356
+ describe '#unfollow' do
357
357
  before do
358
- stub_post("/1.1/friendships/destroy.json").with(:body => {:screen_name => "sferik"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
358
+ stub_post('/1.1/friendships/destroy.json').with(:body => {:screen_name => 'sferik'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
359
359
  end
360
- it "requests the correct resource" do
361
- @client.unfollow("sferik")
362
- expect(a_post("/1.1/friendships/destroy.json").with(:body => {:screen_name => "sferik"})).to have_been_made
360
+ it 'requests the correct resource' do
361
+ @client.unfollow('sferik')
362
+ expect(a_post('/1.1/friendships/destroy.json').with(:body => {:screen_name => 'sferik'})).to have_been_made
363
363
  end
364
- it "returns an array of unfollowed users" do
365
- users = @client.unfollow("sferik")
364
+ it 'returns an array of unfollowed users' do
365
+ users = @client.unfollow('sferik')
366
366
  expect(users).to be_an Array
367
367
  expect(users.first).to be_a Twitter::User
368
- expect(users.first.id).to eq(7505382)
368
+ expect(users.first.id).to eq(7_505_382)
369
369
  end
370
370
  end
371
371
 
372
- describe "#friendship_update" do
372
+ describe '#friendship_update' do
373
373
  before do
374
- stub_post("/1.1/friendships/update.json").with(:body => {:screen_name => "sferik", :retweets => "true"}).to_return(:body => fixture("following.json"), :headers => {:content_type => "application/json; charset=utf-8"})
374
+ stub_post('/1.1/friendships/update.json').with(:body => {:screen_name => 'sferik', :retweets => 'true'}).to_return(:body => fixture('following.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
375
375
  end
376
- it "requests the correct resource" do
377
- @client.friendship_update("sferik", :retweets => true)
378
- expect(a_post("/1.1/friendships/update.json").with(:body => {:screen_name => "sferik", :retweets => "true"})).to have_been_made
376
+ it 'requests the correct resource' do
377
+ @client.friendship_update('sferik', :retweets => true)
378
+ expect(a_post('/1.1/friendships/update.json').with(:body => {:screen_name => 'sferik', :retweets => 'true'})).to have_been_made
379
379
  end
380
- it "returns detailed information about the relationship between two users" do
381
- relationship = @client.friendship_update("sferik", :retweets => true)
380
+ it 'returns detailed information about the relationship between two users' do
381
+ relationship = @client.friendship_update('sferik', :retweets => true)
382
382
  expect(relationship).to be_a Twitter::Relationship
383
- expect(relationship.source.id).to eq(7505382)
383
+ expect(relationship.source.id).to eq(7_505_382)
384
384
  end
385
385
  end
386
386
 
387
- describe "#friendship" do
388
- context "with screen names passed" do
387
+ describe '#friendship' do
388
+ context 'with screen names passed' do
389
389
  before do
390
- stub_get("/1.1/friendships/show.json").with(:query => {:source_screen_name => "sferik", :target_screen_name => "pengwynn"}).to_return(:body => fixture("following.json"), :headers => {:content_type => "application/json; charset=utf-8"})
390
+ stub_get('/1.1/friendships/show.json').with(:query => {:source_screen_name => 'sferik', :target_screen_name => 'pengwynn'}).to_return(:body => fixture('following.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
391
391
  end
392
- it "requests the correct resource" do
393
- @client.friendship("sferik", "pengwynn")
394
- expect(a_get("/1.1/friendships/show.json").with(:query => {:source_screen_name => "sferik", :target_screen_name => "pengwynn"})).to have_been_made
392
+ it 'requests the correct resource' do
393
+ @client.friendship('sferik', 'pengwynn')
394
+ expect(a_get('/1.1/friendships/show.json').with(:query => {:source_screen_name => 'sferik', :target_screen_name => 'pengwynn'})).to have_been_made
395
395
  end
396
- it "returns detailed information about the relationship between two users" do
397
- relationship = @client.friendship("sferik", "pengwynn")
396
+ it 'returns detailed information about the relationship between two users' do
397
+ relationship = @client.friendship('sferik', 'pengwynn')
398
398
  expect(relationship).to be_a Twitter::Relationship
399
- expect(relationship.source.id).to eq(7505382)
399
+ expect(relationship.source.id).to eq(7_505_382)
400
400
  end
401
401
  end
402
- context "with numeric screen names passed" do
402
+ context 'with numeric screen names passed' do
403
403
  before do
404
- stub_get("/1.1/friendships/show.json").with(:query => {:source_screen_name => "0", :target_screen_name => "311"}).to_return(:body => fixture("following.json"), :headers => {:content_type => "application/json; charset=utf-8"})
404
+ stub_get('/1.1/friendships/show.json').with(:query => {:source_screen_name => '0', :target_screen_name => '311'}).to_return(:body => fixture('following.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
405
405
  end
406
- it "requests the correct resource" do
407
- @client.friendship("0", "311")
408
- expect(a_get("/1.1/friendships/show.json").with(:query => {:source_screen_name => "0", :target_screen_name => "311"})).to have_been_made
406
+ it 'requests the correct resource' do
407
+ @client.friendship('0', '311')
408
+ expect(a_get('/1.1/friendships/show.json').with(:query => {:source_screen_name => '0', :target_screen_name => '311'})).to have_been_made
409
409
  end
410
410
  end
411
- context "with user IDs passed" do
411
+ context 'with user IDs passed' do
412
412
  before do
413
- stub_get("/1.1/friendships/show.json").with(:query => {:source_id => "7505382", :target_id => "14100886"}).to_return(:body => fixture("following.json"), :headers => {:content_type => "application/json; charset=utf-8"})
413
+ stub_get('/1.1/friendships/show.json').with(:query => {:source_id => '7505382', :target_id => '14100886'}).to_return(:body => fixture('following.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
414
414
  end
415
- it "requests the correct resource" do
416
- @client.friendship(7505382, 14100886)
417
- expect(a_get("/1.1/friendships/show.json").with(:query => {:source_id => "7505382", :target_id => "14100886"})).to have_been_made
415
+ it 'requests the correct resource' do
416
+ @client.friendship(7_505_382, 14_100_886)
417
+ expect(a_get('/1.1/friendships/show.json').with(:query => {:source_id => '7505382', :target_id => '14100886'})).to have_been_made
418
418
  end
419
419
  end
420
- context "with user objects passed" do
420
+ context 'with user objects passed' do
421
421
  before do
422
- stub_get("/1.1/friendships/show.json").with(:query => {:source_id => "7505382", :target_id => "14100886"}).to_return(:body => fixture("following.json"), :headers => {:content_type => "application/json; charset=utf-8"})
422
+ stub_get('/1.1/friendships/show.json').with(:query => {:source_id => '7505382', :target_id => '14100886'}).to_return(:body => fixture('following.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
423
423
  end
424
- it "requests the correct resource" do
425
- user1 = Twitter::User.new(:id => "7505382")
426
- user2 = Twitter::User.new(:id => "14100886")
424
+ it 'requests the correct resource' do
425
+ user1 = Twitter::User.new(:id => '7505382')
426
+ user2 = Twitter::User.new(:id => '14100886')
427
427
  @client.friendship(user1, user2)
428
- expect(a_get("/1.1/friendships/show.json").with(:query => {:source_id => "7505382", :target_id => "14100886"})).to have_been_made
428
+ expect(a_get('/1.1/friendships/show.json').with(:query => {:source_id => '7505382', :target_id => '14100886'})).to have_been_made
429
429
  end
430
430
  end
431
- context "with URI objects passed" do
431
+ context 'with URI objects passed' do
432
432
  before do
433
- stub_get("/1.1/friendships/show.json").with(:query => {:source_screen_name => "sferik", :target_screen_name => "pengwynn"}).to_return(:body => fixture("following.json"), :headers => {:content_type => "application/json; charset=utf-8"})
433
+ stub_get('/1.1/friendships/show.json').with(:query => {:source_screen_name => 'sferik', :target_screen_name => 'pengwynn'}).to_return(:body => fixture('following.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
434
434
  end
435
- it "requests the correct resource" do
436
- user1 = URI.parse("https://twitter.com/sferik")
437
- user2 = URI.parse("https://twitter.com/pengwynn")
435
+ it 'requests the correct resource' do
436
+ user1 = URI.parse('https://twitter.com/sferik')
437
+ user2 = URI.parse('https://twitter.com/pengwynn')
438
438
  @client.friendship(user1, user2)
439
- expect(a_get("/1.1/friendships/show.json").with(:query => {:source_screen_name => "sferik", :target_screen_name => "pengwynn"})).to have_been_made
439
+ expect(a_get('/1.1/friendships/show.json').with(:query => {:source_screen_name => 'sferik', :target_screen_name => 'pengwynn'})).to have_been_made
440
440
  end
441
441
  end
442
- context "with URI strings passed" do
442
+ context 'with URI strings passed' do
443
443
  before do
444
- stub_get("/1.1/friendships/show.json").with(:query => {:source_screen_name => "sferik", :target_screen_name => "pengwynn"}).to_return(:body => fixture("following.json"), :headers => {:content_type => "application/json; charset=utf-8"})
444
+ stub_get('/1.1/friendships/show.json').with(:query => {:source_screen_name => 'sferik', :target_screen_name => 'pengwynn'}).to_return(:body => fixture('following.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
445
445
  end
446
- it "requests the correct resource" do
447
- @client.friendship("https://twitter.com/sferik", "https://twitter.com/pengwynn")
448
- expect(a_get("/1.1/friendships/show.json").with(:query => {:source_screen_name => "sferik", :target_screen_name => "pengwynn"})).to have_been_made
446
+ it 'requests the correct resource' do
447
+ @client.friendship('https://twitter.com/sferik', 'https://twitter.com/pengwynn')
448
+ expect(a_get('/1.1/friendships/show.json').with(:query => {:source_screen_name => 'sferik', :target_screen_name => 'pengwynn'})).to have_been_made
449
449
  end
450
450
  end
451
451
  end
452
452
 
453
- describe "#friendship?" do
454
- context "with screen names passed" do
453
+ describe '#friendship?' do
454
+ context 'with screen names passed' do
455
455
  before do
456
- stub_get("/1.1/friendships/show.json").with(:query => {:source_screen_name => "sferik", :target_screen_name => "pengwynn"}).to_return(:body => fixture("following.json"), :headers => {:content_type => "application/json; charset=utf-8"})
457
- stub_get("/1.1/friendships/show.json").with(:query => {:source_screen_name => "pengwynn", :target_screen_name => "sferik"}).to_return(:body => fixture("not_following.json"), :headers => {:content_type => "application/json; charset=utf-8"})
456
+ stub_get('/1.1/friendships/show.json').with(:query => {:source_screen_name => 'sferik', :target_screen_name => 'pengwynn'}).to_return(:body => fixture('following.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
457
+ stub_get('/1.1/friendships/show.json').with(:query => {:source_screen_name => 'pengwynn', :target_screen_name => 'sferik'}).to_return(:body => fixture('not_following.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
458
458
  end
459
- it "requests the correct resource" do
460
- @client.friendship?("sferik", "pengwynn")
461
- expect(a_get("/1.1/friendships/show.json").with(:query => {:source_screen_name => "sferik", :target_screen_name => "pengwynn"})).to have_been_made
459
+ it 'requests the correct resource' do
460
+ @client.friendship?('sferik', 'pengwynn')
461
+ expect(a_get('/1.1/friendships/show.json').with(:query => {:source_screen_name => 'sferik', :target_screen_name => 'pengwynn'})).to have_been_made
462
462
  end
463
- it "returns true if user A follows user B" do
464
- friendship = @client.friendship?("sferik", "pengwynn")
463
+ it 'returns true if user A follows user B' do
464
+ friendship = @client.friendship?('sferik', 'pengwynn')
465
465
  expect(friendship).to be true
466
466
  end
467
- it "returns false if user A does not follow user B" do
468
- friendship = @client.friendship?("pengwynn", "sferik")
467
+ it 'returns false if user A does not follow user B' do
468
+ friendship = @client.friendship?('pengwynn', 'sferik')
469
469
  expect(friendship).to be false
470
470
  end
471
471
  end
472
- context "with user IDs passed" do
472
+ context 'with user IDs passed' do
473
473
  before do
474
- stub_get("/1.1/friendships/show.json").with(:query => {:source_id => "7505382", :target_id => "14100886"}).to_return(:body => fixture("following.json"), :headers => {:content_type => "application/json; charset=utf-8"})
474
+ stub_get('/1.1/friendships/show.json').with(:query => {:source_id => '7505382', :target_id => '14100886'}).to_return(:body => fixture('following.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
475
475
  end
476
- it "requests the correct resource" do
477
- @client.friendship?(7505382, 14100886)
478
- expect(a_get("/1.1/friendships/show.json").with(:query => {:source_id => "7505382", :target_id => "14100886"})).to have_been_made
476
+ it 'requests the correct resource' do
477
+ @client.friendship?(7_505_382, 14_100_886)
478
+ expect(a_get('/1.1/friendships/show.json').with(:query => {:source_id => '7505382', :target_id => '14100886'})).to have_been_made
479
479
  end
480
480
  end
481
- context "with user objects passed" do
481
+ context 'with user objects passed' do
482
482
  before do
483
- stub_get("/1.1/friendships/show.json").with(:query => {:source_id => "7505382", :target_id => "14100886"}).to_return(:body => fixture("following.json"), :headers => {:content_type => "application/json; charset=utf-8"})
483
+ stub_get('/1.1/friendships/show.json').with(:query => {:source_id => '7505382', :target_id => '14100886'}).to_return(:body => fixture('following.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
484
484
  end
485
- it "requests the correct resource" do
486
- user1 = Twitter::User.new(:id => "7505382")
487
- user2 = Twitter::User.new(:id => "14100886")
485
+ it 'requests the correct resource' do
486
+ user1 = Twitter::User.new(:id => '7505382')
487
+ user2 = Twitter::User.new(:id => '14100886')
488
488
  @client.friendship?(user1, user2)
489
- expect(a_get("/1.1/friendships/show.json").with(:query => {:source_id => "7505382", :target_id => "14100886"})).to have_been_made
489
+ expect(a_get('/1.1/friendships/show.json').with(:query => {:source_id => '7505382', :target_id => '14100886'})).to have_been_made
490
490
  end
491
491
  end
492
492
  end
493
493
 
494
- describe "#followers" do
495
- context "with a screen_name passed" do
494
+ describe '#followers' do
495
+ context 'with a screen_name passed' do
496
496
  before do
497
- stub_get("/1.1/followers/list.json").with(:query => {:cursor => "-1", :screen_name => "sferik"}).to_return(:body => fixture("followers_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
497
+ stub_get('/1.1/followers/list.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'}).to_return(:body => fixture('followers_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
498
498
  end
499
- it "requests the correct resource" do
500
- @client.followers("sferik")
501
- expect(a_get("/1.1/followers/list.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
499
+ it 'requests the correct resource' do
500
+ @client.followers('sferik')
501
+ expect(a_get('/1.1/followers/list.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
502
502
  end
503
- it "returns a cursor of followers with details for every user the specified user is followed by" do
504
- followers = @client.followers("sferik")
503
+ it 'returns a cursor of followers with details for every user the specified user is followed by' do
504
+ followers = @client.followers('sferik')
505
505
  expect(followers).to be_a Twitter::Cursor
506
506
  expect(followers.first).to be_a Twitter::User
507
507
  end
508
- context "with each" do
508
+ context 'with each' do
509
509
  before do
510
- stub_get("/1.1/followers/list.json").with(:query => {:cursor => "1419103567112105362", :screen_name => "sferik"}).to_return(:body => fixture("followers_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
510
+ stub_get('/1.1/followers/list.json').with(:query => {:cursor => '1419103567112105362', :screen_name => 'sferik'}).to_return(:body => fixture('followers_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
511
511
  end
512
- it "requests the correct resource" do
513
- @client.followers("sferik").each{}
514
- expect(a_get("/1.1/followers/list.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
515
- expect(a_get("/1.1/followers/list.json").with(:query => {:cursor => "1419103567112105362", :screen_name => "sferik"})).to have_been_made
512
+ it 'requests the correct resource' do
513
+ @client.followers('sferik').each {}
514
+ expect(a_get('/1.1/followers/list.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
515
+ expect(a_get('/1.1/followers/list.json').with(:query => {:cursor => '1419103567112105362', :screen_name => 'sferik'})).to have_been_made
516
516
  end
517
517
  end
518
518
  end
519
- context "with a user ID passed" do
519
+ context 'with a user ID passed' do
520
520
  before do
521
- stub_get("/1.1/followers/list.json").with(:query => {:cursor => "-1", :user_id => "7505382"}).to_return(:body => fixture("followers_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
521
+ stub_get('/1.1/followers/list.json').with(:query => {:cursor => '-1', :user_id => '7505382'}).to_return(:body => fixture('followers_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
522
522
  end
523
- it "requests the correct resource" do
524
- @client.followers(7505382)
525
- expect(a_get("/1.1/followers/list.json").with(:query => {:cursor => "-1", :user_id => "7505382"})).to have_been_made
523
+ it 'requests the correct resource' do
524
+ @client.followers(7_505_382)
525
+ expect(a_get('/1.1/followers/list.json').with(:query => {:cursor => '-1', :user_id => '7505382'})).to have_been_made
526
526
  end
527
- context "with each" do
527
+ context 'with each' do
528
528
  before do
529
- stub_get("/1.1/followers/list.json").with(:query => {:cursor => "1419103567112105362", :user_id => "7505382"}).to_return(:body => fixture("followers_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
529
+ stub_get('/1.1/followers/list.json').with(:query => {:cursor => '1419103567112105362', :user_id => '7505382'}).to_return(:body => fixture('followers_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
530
530
  end
531
- it "requests the correct resource" do
532
- @client.followers(7505382).each{}
533
- expect(a_get("/1.1/followers/list.json").with(:query => {:cursor => "-1", :user_id => "7505382"})).to have_been_made
534
- expect(a_get("/1.1/followers/list.json").with(:query => {:cursor => "1419103567112105362", :user_id => "7505382"})).to have_been_made
531
+ it 'requests the correct resource' do
532
+ @client.followers(7_505_382).each {}
533
+ expect(a_get('/1.1/followers/list.json').with(:query => {:cursor => '-1', :user_id => '7505382'})).to have_been_made
534
+ expect(a_get('/1.1/followers/list.json').with(:query => {:cursor => '1419103567112105362', :user_id => '7505382'})).to have_been_made
535
535
  end
536
536
  end
537
537
  end
538
- context "without arguments passed" do
538
+ context 'without arguments passed' do
539
539
  before do
540
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
541
- stub_get("/1.1/followers/list.json").with(:query => {:cursor => "-1", :screen_name => "sferik"}).to_return(:body => fixture("followers_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
540
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
541
+ stub_get('/1.1/followers/list.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'}).to_return(:body => fixture('followers_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
542
542
  end
543
- it "requests the correct resource" do
543
+ it 'requests the correct resource' do
544
544
  @client.followers
545
- expect(a_get("/1.1/account/verify_credentials.json")).to have_been_made
546
- expect(a_get("/1.1/followers/list.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
545
+ expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
546
+ expect(a_get('/1.1/followers/list.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
547
547
  end
548
- it "returns a cursor of followers with details for every user the specified user is followed by" do
548
+ it 'returns a cursor of followers with details for every user the specified user is followed by' do
549
549
  followers = @client.followers
550
550
  expect(followers).to be_a Twitter::Cursor
551
551
  expect(followers.first).to be_a Twitter::User
552
552
  end
553
- context "with each" do
553
+ context 'with each' do
554
554
  before do
555
- stub_get("/1.1/followers/list.json").with(:query => {:cursor => "1419103567112105362", :screen_name => "sferik"}).to_return(:body => fixture("followers_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
555
+ stub_get('/1.1/followers/list.json').with(:query => {:cursor => '1419103567112105362', :screen_name => 'sferik'}).to_return(:body => fixture('followers_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
556
556
  end
557
- it "requests the correct resource" do
558
- @client.followers.each{}
559
- expect(a_get("/1.1/account/verify_credentials.json")).to have_been_made
560
- expect(a_get("/1.1/followers/list.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
561
- expect(a_get("/1.1/followers/list.json").with(:query => {:cursor => "1419103567112105362", :screen_name => "sferik"})).to have_been_made
557
+ it 'requests the correct resource' do
558
+ @client.followers.each {}
559
+ expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
560
+ expect(a_get('/1.1/followers/list.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
561
+ expect(a_get('/1.1/followers/list.json').with(:query => {:cursor => '1419103567112105362', :screen_name => 'sferik'})).to have_been_made
562
562
  end
563
563
  end
564
564
  end
565
565
  end
566
566
 
567
- describe "#friends" do
568
- context "with a screen_name passed" do
567
+ describe '#friends' do
568
+ context 'with a screen_name passed' do
569
569
  before do
570
- stub_get("/1.1/friends/list.json").with(:query => {:cursor => "-1", :screen_name => "sferik"}).to_return(:body => fixture("friends_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
570
+ stub_get('/1.1/friends/list.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'}).to_return(:body => fixture('friends_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
571
571
  end
572
- it "requests the correct resource" do
573
- @client.friends("sferik")
574
- expect(a_get("/1.1/friends/list.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
572
+ it 'requests the correct resource' do
573
+ @client.friends('sferik')
574
+ expect(a_get('/1.1/friends/list.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
575
575
  end
576
- it "returns a cursor of friends with details for every user the specified user is following" do
577
- friends = @client.friends("sferik")
576
+ it 'returns a cursor of friends with details for every user the specified user is following' do
577
+ friends = @client.friends('sferik')
578
578
  expect(friends).to be_a Twitter::Cursor
579
579
  expect(friends.first).to be_a Twitter::User
580
580
  end
581
- context "with each" do
581
+ context 'with each' do
582
582
  before do
583
- stub_get("/1.1/friends/list.json").with(:query => {:cursor => "1418947360875712729", :screen_name => "sferik"}).to_return(:body => fixture("friends_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
583
+ stub_get('/1.1/friends/list.json').with(:query => {:cursor => '1418947360875712729', :screen_name => 'sferik'}).to_return(:body => fixture('friends_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
584
584
  end
585
- it "requests the correct resource" do
586
- @client.friends("sferik").each{}
587
- expect(a_get("/1.1/friends/list.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
588
- expect(a_get("/1.1/friends/list.json").with(:query => {:cursor => "1418947360875712729", :screen_name => "sferik"})).to have_been_made
585
+ it 'requests the correct resource' do
586
+ @client.friends('sferik').each {}
587
+ expect(a_get('/1.1/friends/list.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
588
+ expect(a_get('/1.1/friends/list.json').with(:query => {:cursor => '1418947360875712729', :screen_name => 'sferik'})).to have_been_made
589
589
  end
590
590
  end
591
591
  end
592
- context "with a user ID passed" do
592
+ context 'with a user ID passed' do
593
593
  before do
594
- stub_get("/1.1/friends/list.json").with(:query => {:cursor => "-1", :user_id => "7505382"}).to_return(:body => fixture("friends_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
594
+ stub_get('/1.1/friends/list.json').with(:query => {:cursor => '-1', :user_id => '7505382'}).to_return(:body => fixture('friends_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
595
595
  end
596
- it "requests the correct resource" do
597
- @client.friends(7505382)
598
- expect(a_get("/1.1/friends/list.json").with(:query => {:cursor => "-1", :user_id => "7505382"})).to have_been_made
596
+ it 'requests the correct resource' do
597
+ @client.friends(7_505_382)
598
+ expect(a_get('/1.1/friends/list.json').with(:query => {:cursor => '-1', :user_id => '7505382'})).to have_been_made
599
599
  end
600
- context "with each" do
600
+ context 'with each' do
601
601
  before do
602
- stub_get("/1.1/friends/list.json").with(:query => {:cursor => "1418947360875712729", :user_id => "7505382"}).to_return(:body => fixture("friends_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
602
+ stub_get('/1.1/friends/list.json').with(:query => {:cursor => '1418947360875712729', :user_id => '7505382'}).to_return(:body => fixture('friends_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
603
603
  end
604
- it "requests the correct resource" do
605
- @client.friends(7505382).each{}
606
- expect(a_get("/1.1/friends/list.json").with(:query => {:cursor => "-1", :user_id => "7505382"})).to have_been_made
607
- expect(a_get("/1.1/friends/list.json").with(:query => {:cursor => "1418947360875712729", :user_id => "7505382"})).to have_been_made
604
+ it 'requests the correct resource' do
605
+ @client.friends(7_505_382).each {}
606
+ expect(a_get('/1.1/friends/list.json').with(:query => {:cursor => '-1', :user_id => '7505382'})).to have_been_made
607
+ expect(a_get('/1.1/friends/list.json').with(:query => {:cursor => '1418947360875712729', :user_id => '7505382'})).to have_been_made
608
608
  end
609
609
  end
610
610
  end
611
- context "without arguments passed" do
611
+ context 'without arguments passed' do
612
612
  before do
613
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
614
- stub_get("/1.1/friends/list.json").with(:query => {:cursor => "-1", :screen_name => "sferik"}).to_return(:body => fixture("friends_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
613
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
614
+ stub_get('/1.1/friends/list.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'}).to_return(:body => fixture('friends_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
615
615
  end
616
- it "requests the correct resource" do
616
+ it 'requests the correct resource' do
617
617
  @client.friends
618
- expect(a_get("/1.1/account/verify_credentials.json")).to have_been_made
619
- expect(a_get("/1.1/friends/list.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
618
+ expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
619
+ expect(a_get('/1.1/friends/list.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
620
620
  end
621
- it "returns a cursor of friends with details for every user the specified user is following" do
621
+ it 'returns a cursor of friends with details for every user the specified user is following' do
622
622
  friends = @client.friends
623
623
  expect(friends).to be_a Twitter::Cursor
624
624
  expect(friends.first).to be_a Twitter::User
625
625
  end
626
- context "with each" do
626
+ context 'with each' do
627
627
  before do
628
- stub_get("/1.1/friends/list.json").with(:query => {:cursor => "1418947360875712729", :screen_name => "sferik"}).to_return(:body => fixture("friends_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
628
+ stub_get('/1.1/friends/list.json').with(:query => {:cursor => '1418947360875712729', :screen_name => 'sferik'}).to_return(:body => fixture('friends_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
629
629
  end
630
- it "requests the correct resource" do
631
- @client.friends.each{}
632
- expect(a_get("/1.1/account/verify_credentials.json")).to have_been_made
633
- expect(a_get("/1.1/friends/list.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made
634
- expect(a_get("/1.1/friends/list.json").with(:query => {:cursor => "1418947360875712729", :screen_name => "sferik"})).to have_been_made
630
+ it 'requests the correct resource' do
631
+ @client.friends.each {}
632
+ expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
633
+ expect(a_get('/1.1/friends/list.json').with(:query => {:cursor => '-1', :screen_name => 'sferik'})).to have_been_made
634
+ expect(a_get('/1.1/friends/list.json').with(:query => {:cursor => '1418947360875712729', :screen_name => 'sferik'})).to have_been_made
635
635
  end
636
636
  end
637
637
  end
638
638
  end
639
639
 
640
- describe "#no_retweet_ids" do
640
+ describe '#no_retweet_ids' do
641
641
  before do
642
- stub_get("/1.1/friendships/no_retweets/ids.json").to_return(:body => fixture("ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
642
+ stub_get('/1.1/friendships/no_retweets/ids.json').to_return(:body => fixture('ids.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
643
643
  end
644
- it "requests the correct resource" do
644
+ it 'requests the correct resource' do
645
645
  @client.no_retweet_ids
646
- expect(a_get("/1.1/friendships/no_retweets/ids.json")).to have_been_made
646
+ expect(a_get('/1.1/friendships/no_retweets/ids.json')).to have_been_made
647
647
  end
648
- it "requests the correct resource when the alias is called" do
648
+ it 'requests the correct resource when the alias is called' do
649
649
  @client.no_retweets_ids
650
- expect(a_get("/1.1/friendships/no_retweets/ids.json")).to have_been_made
650
+ expect(a_get('/1.1/friendships/no_retweets/ids.json')).to have_been_made
651
651
  end
652
- it "returns users ids of those that do not wish to be retweeted" do
652
+ it 'returns users ids of those that do not wish to be retweeted' do
653
653
  no_retweet_ids = @client.no_retweet_ids
654
654
  expect(no_retweet_ids).to be_an Array
655
655
  expect(no_retweet_ids.first).to be_an Integer