twitter 5.1.1 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,65 +3,65 @@ require 'helper'
3
3
  describe Twitter::REST::API::PlacesAndGeo 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 "#place" do
9
+ describe '#place' do
10
10
  before do
11
- stub_get("/1.1/geo/id/247f43d441defc03.json").to_return(:body => fixture("place.json"), :headers => {:content_type => "application/json; charset=utf-8"})
11
+ stub_get('/1.1/geo/id/247f43d441defc03.json').to_return(:body => fixture('place.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
12
12
  end
13
- it "requests the correct resource" do
14
- @client.place("247f43d441defc03")
15
- expect(a_get("/1.1/geo/id/247f43d441defc03.json")).to have_been_made
13
+ it 'requests the correct resource' do
14
+ @client.place('247f43d441defc03')
15
+ expect(a_get('/1.1/geo/id/247f43d441defc03.json')).to have_been_made
16
16
  end
17
- it "returns a place" do
18
- place = @client.place("247f43d441defc03")
19
- expect(place.name).to eq("Twitter HQ")
17
+ it 'returns a place' do
18
+ place = @client.place('247f43d441defc03')
19
+ expect(place.name).to eq('Twitter HQ')
20
20
  end
21
21
  end
22
22
 
23
- describe "#reverse_geocode" do
23
+ describe '#reverse_geocode' do
24
24
  before do
25
- stub_get("/1.1/geo/reverse_geocode.json").with(:query => {:lat => "37.7821120598956", :long => "-122.400612831116"}).to_return(:body => fixture("places.json"), :headers => {:content_type => "application/json; charset=utf-8"})
25
+ stub_get('/1.1/geo/reverse_geocode.json').with(:query => {:lat => '37.7821120598956', :long => '-122.400612831116'}).to_return(:body => fixture('places.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
26
26
  end
27
- it "requests the correct resource" do
28
- @client.reverse_geocode(:lat => "37.7821120598956", :long => "-122.400612831116")
29
- expect(a_get("/1.1/geo/reverse_geocode.json").with(:query => {:lat => "37.7821120598956", :long => "-122.400612831116"})).to have_been_made
27
+ it 'requests the correct resource' do
28
+ @client.reverse_geocode(:lat => '37.7821120598956', :long => '-122.400612831116')
29
+ expect(a_get('/1.1/geo/reverse_geocode.json').with(:query => {:lat => '37.7821120598956', :long => '-122.400612831116'})).to have_been_made
30
30
  end
31
- it "returns places" do
32
- places = @client.reverse_geocode(:lat => "37.7821120598956", :long => "-122.400612831116")
31
+ it 'returns places' do
32
+ places = @client.reverse_geocode(:lat => '37.7821120598956', :long => '-122.400612831116')
33
33
  expect(places).to be_a Twitter::GeoResults
34
- expect(places.first.name).to eq("Bernal Heights")
34
+ expect(places.first.name).to eq('Bernal Heights')
35
35
  end
36
36
  end
37
37
 
38
- describe "#geo_search" do
38
+ describe '#geo_search' do
39
39
  before do
40
- stub_get("/1.1/geo/search.json").with(:query => {:ip => "74.125.19.104"}).to_return(:body => fixture("places.json"), :headers => {:content_type => "application/json; charset=utf-8"})
40
+ stub_get('/1.1/geo/search.json').with(:query => {:ip => '74.125.19.104'}).to_return(:body => fixture('places.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
41
41
  end
42
- it "requests the correct resource" do
43
- @client.geo_search(:ip => "74.125.19.104")
44
- expect(a_get("/1.1/geo/search.json").with(:query => {:ip => "74.125.19.104"})).to have_been_made
42
+ it 'requests the correct resource' do
43
+ @client.geo_search(:ip => '74.125.19.104')
44
+ expect(a_get('/1.1/geo/search.json').with(:query => {:ip => '74.125.19.104'})).to have_been_made
45
45
  end
46
- it "returns nearby places" do
47
- places = @client.geo_search(:ip => "74.125.19.104")
46
+ it 'returns nearby places' do
47
+ places = @client.geo_search(:ip => '74.125.19.104')
48
48
  expect(places).to be_a Twitter::GeoResults
49
- expect(places.first.name).to eq("Bernal Heights")
49
+ expect(places.first.name).to eq('Bernal Heights')
50
50
  end
51
51
  end
52
52
 
53
- describe "#similar_places" do
53
+ describe '#similar_places' do
54
54
  before do
55
- stub_get("/1.1/geo/similar_places.json").with(:query => {:lat => "37.7821120598956", :long => "-122.400612831116", :name => "Twitter HQ"}).to_return(:body => fixture("places.json"), :headers => {:content_type => "application/json; charset=utf-8"})
55
+ stub_get('/1.1/geo/similar_places.json').with(:query => {:lat => '37.7821120598956', :long => '-122.400612831116', :name => 'Twitter HQ'}).to_return(:body => fixture('places.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
56
56
  end
57
- it "requests the correct resource" do
58
- @client.similar_places(:lat => "37.7821120598956", :long => "-122.400612831116", :name => "Twitter HQ")
59
- expect(a_get("/1.1/geo/similar_places.json").with(:query => {:lat => "37.7821120598956", :long => "-122.400612831116", :name => "Twitter HQ"})).to have_been_made
57
+ it 'requests the correct resource' do
58
+ @client.similar_places(:lat => '37.7821120598956', :long => '-122.400612831116', :name => 'Twitter HQ')
59
+ expect(a_get('/1.1/geo/similar_places.json').with(:query => {:lat => '37.7821120598956', :long => '-122.400612831116', :name => 'Twitter HQ'})).to have_been_made
60
60
  end
61
- it "returns similar places" do
62
- places = @client.similar_places(:lat => "37.7821120598956", :long => "-122.400612831116", :name => "Twitter HQ")
61
+ it 'returns similar places' do
62
+ places = @client.similar_places(:lat => '37.7821120598956', :long => '-122.400612831116', :name => 'Twitter HQ')
63
63
  expect(places).to be_a Twitter::GeoResults
64
- expect(places.first.name).to eq("Bernal Heights")
64
+ expect(places.first.name).to eq('Bernal Heights')
65
65
  end
66
66
  end
67
67
 
@@ -3,65 +3,65 @@ require 'helper'
3
3
  describe Twitter::REST::API::Help 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 "#configuration" do
9
+ describe '#configuration' do
10
10
  before do
11
- stub_get("/1.1/help/configuration.json").to_return(:body => fixture("configuration.json"), :headers => {:content_type => "application/json; charset=utf-8"})
11
+ stub_get('/1.1/help/configuration.json').to_return(:body => fixture('configuration.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
12
12
  end
13
- it "requests the correct resource" do
13
+ it 'requests the correct resource' do
14
14
  @client.configuration
15
- expect(a_get("/1.1/help/configuration.json")).to have_been_made
15
+ expect(a_get('/1.1/help/configuration.json')).to have_been_made
16
16
  end
17
- it "returns Twitter's current configuration" do
17
+ it 'returns the Twitter configuration' do
18
18
  configuration = @client.configuration
19
19
  expect(configuration).to be_a Twitter::Configuration
20
20
  expect(configuration.characters_reserved_per_media).to eq(20)
21
21
  end
22
22
  end
23
23
 
24
- describe "#languages" do
24
+ describe '#languages' do
25
25
  before do
26
- stub_get("/1.1/help/languages.json").to_return(:body => fixture("languages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
26
+ stub_get('/1.1/help/languages.json').to_return(:body => fixture('languages.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
27
27
  end
28
- it "requests the correct resource" do
28
+ it 'requests the correct resource' do
29
29
  @client.languages
30
- expect(a_get("/1.1/help/languages.json")).to have_been_made
30
+ expect(a_get('/1.1/help/languages.json')).to have_been_made
31
31
  end
32
- it "returns the list of languages supported by Twitter" do
32
+ it 'returns the list of languages supported by Twitter' do
33
33
  languages = @client.languages
34
34
  expect(languages).to be_an Array
35
35
  expect(languages.first).to be_a Twitter::Language
36
- expect(languages.first.name).to eq("Portuguese")
36
+ expect(languages.first.name).to eq('Portuguese')
37
37
  end
38
38
  end
39
39
 
40
- describe "#privacy" do
40
+ describe '#privacy' do
41
41
  before do
42
- stub_get("/1.1/help/privacy.json").to_return(:body => fixture("privacy.json"), :headers => {:content_type => "application/json; charset=utf-8"})
42
+ stub_get('/1.1/help/privacy.json').to_return(:body => fixture('privacy.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
43
43
  end
44
- it "requests the correct resource" do
44
+ it 'requests the correct resource' do
45
45
  @client.privacy
46
- expect(a_get("/1.1/help/privacy.json")).to have_been_made
46
+ expect(a_get('/1.1/help/privacy.json')).to have_been_made
47
47
  end
48
- it "returns Twitter's Privacy Policy" do
48
+ it 'returns the Twitter Privacy Policy' do
49
49
  privacy = @client.privacy
50
- expect(privacy.split.first).to eq("Twitter")
50
+ expect(privacy.split.first).to eq('Twitter')
51
51
  end
52
52
  end
53
53
 
54
- describe "#tos" do
54
+ describe '#tos' do
55
55
  before do
56
- stub_get("/1.1/help/tos.json").to_return(:body => fixture("tos.json"), :headers => {:content_type => "application/json; charset=utf-8"})
56
+ stub_get('/1.1/help/tos.json').to_return(:body => fixture('tos.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.tos
60
- expect(a_get("/1.1/help/tos.json")).to have_been_made
60
+ expect(a_get('/1.1/help/tos.json')).to have_been_made
61
61
  end
62
- it "returns Twitter's Terms of Service" do
62
+ it 'returns the Twitter Terms of Service' do
63
63
  tos = @client.tos
64
- expect(tos.split.first).to eq("Terms")
64
+ expect(tos.split.first).to eq('Terms')
65
65
  end
66
66
  end
67
67
 
@@ -3,885 +3,885 @@ require 'helper'
3
3
  describe Twitter::REST::API::Lists 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 "#lists" do
9
+ describe '#lists' do
10
10
  before do
11
- stub_get("/1.1/lists/list.json").to_return(:body => fixture("lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
11
+ stub_get('/1.1/lists/list.json').to_return(:body => fixture('lists.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
12
12
  end
13
- it "requests the correct resource" do
13
+ it 'requests the correct resource' do
14
14
  @client.lists
15
- expect(a_get("/1.1/lists/list.json")).to have_been_made
15
+ expect(a_get('/1.1/lists/list.json')).to have_been_made
16
16
  end
17
- it "returns the requested list" do
17
+ it 'returns the requested list' do
18
18
  lists = @client.lists
19
19
  expect(lists).to be_an Array
20
20
  expect(lists.first).to be_a Twitter::List
21
- expect(lists.first.name).to eq("Rubyists")
21
+ expect(lists.first.name).to eq('Rubyists')
22
22
  end
23
23
  end
24
24
 
25
- describe "#list_timeline" do
26
- context "with a screen name passed" do
25
+ describe '#list_timeline' do
26
+ context 'with a screen name passed' do
27
27
  before do
28
- stub_get("/1.1/lists/statuses.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
28
+ stub_get('/1.1/lists/statuses.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).to_return(:body => fixture('statuses.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
29
29
  end
30
- it "requests the correct resource" do
31
- @client.list_timeline("sferik", "presidents")
32
- expect(a_get("/1.1/lists/statuses.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents"})).to have_been_made
30
+ it 'requests the correct resource' do
31
+ @client.list_timeline('sferik', 'presidents')
32
+ expect(a_get('/1.1/lists/statuses.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'})).to have_been_made
33
33
  end
34
- it "returns the timeline for members of the specified list" do
35
- tweets = @client.list_timeline("sferik", "presidents")
34
+ it 'returns the timeline for members of the specified list' do
35
+ tweets = @client.list_timeline('sferik', 'presidents')
36
36
  expect(tweets).to be_an Array
37
37
  expect(tweets.first).to be_a Twitter::Tweet
38
- expect(tweets.first.text).to eq("Happy Birthday @imdane. Watch out for those @rally pranksters!")
38
+ expect(tweets.first.text).to eq('Happy Birthday @imdane. Watch out for those @rally pranksters!')
39
39
  end
40
- context "with a URI object passed" do
41
- it "requests the correct resource" do
42
- list = URI.parse("https://twitter.com/sferik/presidents")
40
+ context 'with a URI object passed' do
41
+ it 'requests the correct resource' do
42
+ list = URI.parse('https://twitter.com/sferik/presidents')
43
43
  @client.list_timeline(list)
44
- expect(a_get("/1.1/lists/statuses.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents"})).to have_been_made
44
+ expect(a_get('/1.1/lists/statuses.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'})).to have_been_made
45
45
  end
46
46
  end
47
- context "with a URI string passed" do
48
- it "requests the correct resource" do
49
- @client.list_timeline("https://twitter.com/sferik/presidents")
50
- expect(a_get("/1.1/lists/statuses.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents"})).to have_been_made
47
+ context 'with a URI string passed' do
48
+ it 'requests the correct resource' do
49
+ @client.list_timeline('https://twitter.com/sferik/presidents')
50
+ expect(a_get('/1.1/lists/statuses.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'})).to have_been_made
51
51
  end
52
52
  end
53
- context "with URI objects passed" do
54
- it "requests the correct resource" do
55
- user = URI.parse("https://twitter.com/sferik")
56
- list = URI.parse("https://twitter.com/sferik/presidents")
53
+ context 'with URI objects passed' do
54
+ it 'requests the correct resource' do
55
+ user = URI.parse('https://twitter.com/sferik')
56
+ list = URI.parse('https://twitter.com/sferik/presidents')
57
57
  @client.list_timeline(user, list)
58
- expect(a_get("/1.1/lists/statuses.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents"})).to have_been_made
58
+ expect(a_get('/1.1/lists/statuses.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'})).to have_been_made
59
59
  end
60
60
  end
61
- context "with URI strings passed" do
62
- it "requests the correct resource" do
63
- @client.list_timeline("https://twitter.com/sferik", "https://twitter.com/sferik/presidents")
64
- expect(a_get("/1.1/lists/statuses.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents"})).to have_been_made
61
+ context 'with URI strings passed' do
62
+ it 'requests the correct resource' do
63
+ @client.list_timeline('https://twitter.com/sferik', 'https://twitter.com/sferik/presidents')
64
+ expect(a_get('/1.1/lists/statuses.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'})).to have_been_made
65
65
  end
66
66
  end
67
67
  end
68
- context "without a screen name passed" do
68
+ context 'without a screen name passed' do
69
69
  before do
70
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
71
- stub_get("/1.1/lists/statuses.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
70
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
71
+ stub_get('/1.1/lists/statuses.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).to_return(:body => fixture('statuses.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
72
72
  end
73
- it "requests the correct resource" do
74
- @client.list_timeline("presidents")
75
- expect(a_get("/1.1/lists/statuses.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents"})).to have_been_made
73
+ it 'requests the correct resource' do
74
+ @client.list_timeline('presidents')
75
+ expect(a_get('/1.1/lists/statuses.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'})).to have_been_made
76
76
  end
77
77
  end
78
78
  end
79
79
 
80
- describe "#remove_list_member" do
81
- context "with a screen name passed" do
80
+ describe '#remove_list_member' do
81
+ context 'with a screen name passed' do
82
82
  before do
83
- stub_post("/1.1/lists/members/destroy.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
83
+ stub_post('/1.1/lists/members/destroy.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
84
84
  end
85
- it "requests the correct resource" do
86
- @client.remove_list_member("sferik", "presidents", 813286)
87
- expect(a_post("/1.1/lists/members/destroy.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286"})).to have_been_made
85
+ it 'requests the correct resource' do
86
+ @client.remove_list_member('sferik', 'presidents', 813_286)
87
+ expect(a_post('/1.1/lists/members/destroy.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'})).to have_been_made
88
88
  end
89
- it "returns the list" do
90
- list = @client.remove_list_member("sferik", "presidents", 813286)
89
+ it 'returns the list' do
90
+ list = @client.remove_list_member('sferik', 'presidents', 813_286)
91
91
  expect(list).to be_a Twitter::List
92
- expect(list.name).to eq("presidents")
92
+ expect(list.name).to eq('presidents')
93
93
  end
94
94
  end
95
- context "without a screen name passed" do
95
+ context 'without a screen name passed' do
96
96
  before do
97
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
98
- stub_post("/1.1/lists/members/destroy.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
97
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
98
+ stub_post('/1.1/lists/members/destroy.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
99
99
  end
100
- it "requests the correct resource" do
101
- @client.remove_list_member("presidents", 813286)
102
- expect(a_post("/1.1/lists/members/destroy.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286"})).to have_been_made
100
+ it 'requests the correct resource' do
101
+ @client.remove_list_member('presidents', 813_286)
102
+ expect(a_post('/1.1/lists/members/destroy.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'})).to have_been_made
103
103
  end
104
104
  end
105
105
  end
106
106
 
107
- describe "#memberships" do
108
- context "with a screen name passed" do
107
+ describe '#memberships' do
108
+ context 'with a screen name passed' do
109
109
  before do
110
- stub_get("/1.1/lists/memberships.json").with(:query => {:screen_name => "sferik", :cursor => "-1"}).to_return(:body => fixture("memberships.json"), :headers => {:content_type => "application/json; charset=utf-8"})
110
+ stub_get('/1.1/lists/memberships.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'}).to_return(:body => fixture('memberships.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
111
111
  end
112
- it "requests the correct resource" do
113
- @client.memberships("sferik")
114
- expect(a_get("/1.1/lists/memberships.json").with(:query => {:screen_name => "sferik", :cursor => "-1"})).to have_been_made
112
+ it 'requests the correct resource' do
113
+ @client.memberships('sferik')
114
+ expect(a_get('/1.1/lists/memberships.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
115
115
  end
116
- it "returns the lists the specified user has been added to" do
117
- memberships = @client.memberships("sferik")
116
+ it 'returns the lists the specified user has been added to' do
117
+ memberships = @client.memberships('sferik')
118
118
  expect(memberships).to be_a Twitter::Cursor
119
119
  expect(memberships.first).to be_a Twitter::List
120
- expect(memberships.first.name).to eq("developer")
120
+ expect(memberships.first.name).to eq('developer')
121
121
  end
122
- context "with each" do
122
+ context 'with each' do
123
123
  before do
124
- stub_get("/1.1/lists/memberships.json").with(:query => {:screen_name => "sferik", :cursor => "1401037770457540712"}).to_return(:body => fixture("memberships2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
124
+ stub_get('/1.1/lists/memberships.json').with(:query => {:screen_name => 'sferik', :cursor => '1401037770457540712'}).to_return(:body => fixture('memberships2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
125
125
  end
126
- it "requests the correct resource" do
127
- @client.memberships("sferik").each{}
128
- expect(a_get("/1.1/lists/memberships.json").with(:query => {:screen_name => "sferik", :cursor => "-1"})).to have_been_made
129
- expect(a_get("/1.1/lists/memberships.json").with(:query => {:screen_name => "sferik", :cursor => "1401037770457540712"})).to have_been_made
126
+ it 'requests the correct resource' do
127
+ @client.memberships('sferik').each {}
128
+ expect(a_get('/1.1/lists/memberships.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
129
+ expect(a_get('/1.1/lists/memberships.json').with(:query => {:screen_name => 'sferik', :cursor => '1401037770457540712'})).to have_been_made
130
130
  end
131
131
  end
132
132
  end
133
- context "with a user ID passed" do
133
+ context 'with a user ID passed' do
134
134
  before do
135
- stub_get("/1.1/lists/memberships.json").with(:query => {:user_id => "7505382", :cursor => "-1"}).to_return(:body => fixture("memberships.json"), :headers => {:content_type => "application/json; charset=utf-8"})
135
+ stub_get('/1.1/lists/memberships.json').with(:query => {:user_id => '7505382', :cursor => '-1'}).to_return(:body => fixture('memberships.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
136
136
  end
137
- it "requests the correct resource" do
138
- @client.memberships(7505382)
139
- expect(a_get("/1.1/lists/memberships.json").with(:query => {:user_id => "7505382", :cursor => "-1"})).to have_been_made
137
+ it 'requests the correct resource' do
138
+ @client.memberships(7_505_382)
139
+ expect(a_get('/1.1/lists/memberships.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
140
140
  end
141
- context "with each" do
141
+ context 'with each' do
142
142
  before do
143
- stub_get("/1.1/lists/memberships.json").with(:query => {:user_id => "7505382", :cursor => "1401037770457540712"}).to_return(:body => fixture("memberships2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
143
+ stub_get('/1.1/lists/memberships.json').with(:query => {:user_id => '7505382', :cursor => '1401037770457540712'}).to_return(:body => fixture('memberships2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
144
144
  end
145
- it "requests the correct resource" do
146
- @client.memberships(7505382).each{}
147
- expect(a_get("/1.1/lists/memberships.json").with(:query => {:user_id => "7505382", :cursor => "-1"})).to have_been_made
148
- expect(a_get("/1.1/lists/memberships.json").with(:query => {:user_id => "7505382", :cursor => "1401037770457540712"})).to have_been_made
145
+ it 'requests the correct resource' do
146
+ @client.memberships(7_505_382).each {}
147
+ expect(a_get('/1.1/lists/memberships.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
148
+ expect(a_get('/1.1/lists/memberships.json').with(:query => {:user_id => '7505382', :cursor => '1401037770457540712'})).to have_been_made
149
149
  end
150
150
  end
151
151
  end
152
- context "without a screen name passed" do
152
+ context 'without a screen name passed' do
153
153
  before do
154
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
155
- stub_get("/1.1/lists/memberships.json").with(:query => {:screen_name => "sferik", :cursor => "-1"}).to_return(:body => fixture("memberships.json"), :headers => {:content_type => "application/json; charset=utf-8"})
154
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
155
+ stub_get('/1.1/lists/memberships.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'}).to_return(:body => fixture('memberships.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
156
156
  end
157
- it "requests the correct resource" do
157
+ it 'requests the correct resource' do
158
158
  @client.memberships
159
- expect(a_get("/1.1/lists/memberships.json").with(:query => {:screen_name => "sferik", :cursor => "-1"})).to have_been_made
159
+ expect(a_get('/1.1/lists/memberships.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
160
160
  end
161
- context "with each" do
161
+ context 'with each' do
162
162
  before do
163
- stub_get("/1.1/lists/memberships.json").with(:query => {:screen_name => "sferik", :cursor => "1401037770457540712"}).to_return(:body => fixture("memberships2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
163
+ stub_get('/1.1/lists/memberships.json').with(:query => {:screen_name => 'sferik', :cursor => '1401037770457540712'}).to_return(:body => fixture('memberships2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
164
164
  end
165
- it "requests the correct resource" do
166
- @client.memberships.each{}
167
- expect(a_get("/1.1/lists/memberships.json").with(:query => {:screen_name => "sferik", :cursor => "-1"})).to have_been_made
168
- expect(a_get("/1.1/lists/memberships.json").with(:query => {:screen_name => "sferik", :cursor => "1401037770457540712"})).to have_been_made
165
+ it 'requests the correct resource' do
166
+ @client.memberships.each {}
167
+ expect(a_get('/1.1/lists/memberships.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
168
+ expect(a_get('/1.1/lists/memberships.json').with(:query => {:screen_name => 'sferik', :cursor => '1401037770457540712'})).to have_been_made
169
169
  end
170
170
  end
171
171
  end
172
172
  end
173
173
 
174
- describe "#list_subscribers" do
175
- context "with a screen name passed" do
174
+ describe '#list_subscribers' do
175
+ context 'with a screen name passed' do
176
176
  before do
177
- stub_get("/1.1/lists/subscribers.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "-1"}).to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
177
+ stub_get('/1.1/lists/subscribers.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '-1'}).to_return(:body => fixture('users_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
178
178
  end
179
- it "requests the correct resource" do
180
- @client.list_subscribers("sferik", "presidents")
181
- expect(a_get("/1.1/lists/subscribers.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "-1"})).to have_been_made
179
+ it 'requests the correct resource' do
180
+ @client.list_subscribers('sferik', 'presidents')
181
+ expect(a_get('/1.1/lists/subscribers.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '-1'})).to have_been_made
182
182
  end
183
- it "returns the subscribers of the specified list" do
184
- list_subscribers = @client.list_subscribers("sferik", "presidents")
183
+ it 'returns the subscribers of the specified list' do
184
+ list_subscribers = @client.list_subscribers('sferik', 'presidents')
185
185
  expect(list_subscribers).to be_a Twitter::Cursor
186
186
  expect(list_subscribers.first).to be_a Twitter::User
187
- expect(list_subscribers.first.id).to eq(7505382)
187
+ expect(list_subscribers.first.id).to eq(7_505_382)
188
188
  end
189
- context "with each" do
189
+ context 'with each' do
190
190
  before do
191
- stub_get("/1.1/lists/subscribers.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "1322801608223717003"}).to_return(:body => fixture("users_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
191
+ stub_get('/1.1/lists/subscribers.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '1322801608223717003'}).to_return(:body => fixture('users_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
192
192
  end
193
- it "requests the correct resource" do
194
- @client.list_subscribers("sferik", "presidents").each{}
195
- expect(a_get("/1.1/lists/subscribers.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "-1"})).to have_been_made
196
- expect(a_get("/1.1/lists/subscribers.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "1322801608223717003"})).to have_been_made
193
+ it 'requests the correct resource' do
194
+ @client.list_subscribers('sferik', 'presidents').each {}
195
+ expect(a_get('/1.1/lists/subscribers.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '-1'})).to have_been_made
196
+ expect(a_get('/1.1/lists/subscribers.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '1322801608223717003'})).to have_been_made
197
197
  end
198
198
  end
199
199
  end
200
- context "with a user ID passed" do
200
+ context 'with a user ID passed' do
201
201
  before do
202
- stub_get("/1.1/lists/subscribers.json").with(:query => {:owner_id => "7505382", :slug => "presidents", :cursor => "-1"}).to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
202
+ stub_get('/1.1/lists/subscribers.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '-1'}).to_return(:body => fixture('users_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
203
203
  end
204
- it "requests the correct resource" do
205
- @client.list_subscribers(7505382, "presidents")
206
- expect(a_get("/1.1/lists/subscribers.json").with(:query => {:owner_id => "7505382", :slug => "presidents", :cursor => "-1"})).to have_been_made
204
+ it 'requests the correct resource' do
205
+ @client.list_subscribers(7_505_382, 'presidents')
206
+ expect(a_get('/1.1/lists/subscribers.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '-1'})).to have_been_made
207
207
  end
208
- context "with each" do
208
+ context 'with each' do
209
209
  before do
210
- stub_get("/1.1/lists/subscribers.json").with(:query => {:owner_id => "7505382", :slug => "presidents", :cursor => "1322801608223717003"}).to_return(:body => fixture("users_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
210
+ stub_get('/1.1/lists/subscribers.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '1322801608223717003'}).to_return(:body => fixture('users_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
211
211
  end
212
- it "requests the correct resource" do
213
- @client.list_subscribers(7505382, "presidents").each{}
214
- expect(a_get("/1.1/lists/subscribers.json").with(:query => {:owner_id => "7505382", :slug => "presidents", :cursor => "-1"})).to have_been_made
215
- expect(a_get("/1.1/lists/subscribers.json").with(:query => {:owner_id => "7505382", :slug => "presidents", :cursor => "1322801608223717003"})).to have_been_made
212
+ it 'requests the correct resource' do
213
+ @client.list_subscribers(7_505_382, 'presidents').each {}
214
+ expect(a_get('/1.1/lists/subscribers.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '-1'})).to have_been_made
215
+ expect(a_get('/1.1/lists/subscribers.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '1322801608223717003'})).to have_been_made
216
216
  end
217
217
  end
218
218
  end
219
- context "without a screen name passed" do
219
+ context 'without a screen name passed' do
220
220
  before do
221
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
222
- stub_get("/1.1/lists/subscribers.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "-1"}).to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
221
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
222
+ stub_get('/1.1/lists/subscribers.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '-1'}).to_return(:body => fixture('users_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
223
223
  end
224
- it "requests the correct resource" do
225
- @client.list_subscribers("presidents")
226
- expect(a_get("/1.1/lists/subscribers.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "-1"})).to have_been_made
224
+ it 'requests the correct resource' do
225
+ @client.list_subscribers('presidents')
226
+ expect(a_get('/1.1/lists/subscribers.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '-1'})).to have_been_made
227
227
  end
228
- context "with each" do
228
+ context 'with each' do
229
229
  before do
230
- stub_get("/1.1/lists/subscribers.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "1322801608223717003"}).to_return(:body => fixture("users_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
230
+ stub_get('/1.1/lists/subscribers.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '1322801608223717003'}).to_return(:body => fixture('users_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
231
231
  end
232
- it "requests the correct resource" do
233
- @client.list_subscribers("presidents").each{}
234
- expect(a_get("/1.1/lists/subscribers.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "-1"})).to have_been_made
235
- expect(a_get("/1.1/lists/subscribers.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "1322801608223717003"})).to have_been_made
232
+ it 'requests the correct resource' do
233
+ @client.list_subscribers('presidents').each {}
234
+ expect(a_get('/1.1/lists/subscribers.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '-1'})).to have_been_made
235
+ expect(a_get('/1.1/lists/subscribers.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '1322801608223717003'})).to have_been_made
236
236
  end
237
237
  end
238
238
  end
239
239
  end
240
240
 
241
- describe "#list_subscribe" do
242
- context "with a screen name passed" do
241
+ describe '#list_subscribe' do
242
+ context 'with a screen name passed' do
243
243
  before do
244
- stub_post("/1.1/lists/subscribers/create.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
244
+ stub_post('/1.1/lists/subscribers/create.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
245
245
  end
246
- it "requests the correct resource" do
247
- @client.list_subscribe("sferik", "presidents")
248
- expect(a_post("/1.1/lists/subscribers/create.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents"})).to have_been_made
246
+ it 'requests the correct resource' do
247
+ @client.list_subscribe('sferik', 'presidents')
248
+ expect(a_post('/1.1/lists/subscribers/create.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'})).to have_been_made
249
249
  end
250
- it "returns the specified list" do
251
- list = @client.list_subscribe("sferik", "presidents")
250
+ it 'returns the specified list' do
251
+ list = @client.list_subscribe('sferik', 'presidents')
252
252
  expect(list).to be_a Twitter::List
253
- expect(list.name).to eq("presidents")
253
+ expect(list.name).to eq('presidents')
254
254
  end
255
255
  end
256
- context "without a screen name passed" do
256
+ context 'without a screen name passed' do
257
257
  before do
258
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
259
- stub_post("/1.1/lists/subscribers/create.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
258
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
259
+ stub_post('/1.1/lists/subscribers/create.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
260
260
  end
261
- it "requests the correct resource" do
262
- @client.list_subscribe("presidents")
263
- expect(a_post("/1.1/lists/subscribers/create.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents"})).to have_been_made
261
+ it 'requests the correct resource' do
262
+ @client.list_subscribe('presidents')
263
+ expect(a_post('/1.1/lists/subscribers/create.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'})).to have_been_made
264
264
  end
265
265
  end
266
266
  end
267
267
 
268
- describe "#list_subscriber?" do
269
- context "with a screen name passed" do
268
+ describe '#list_subscriber?' do
269
+ context 'with a screen name passed' do
270
270
  before do
271
- stub_get("/1.1/lists/subscribers/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
272
- stub_get("/1.1/lists/subscribers/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "18755393"}).to_return(:body => fixture("not_found.json"), :status => 404, :headers => {:content_type => "application/json; charset=utf-8"})
273
- stub_get("/1.1/lists/subscribers/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "12345678"}).to_return(:body => fixture("not_found.json"), :status => 403, :headers => {:content_type => "application/json; charset=utf-8"})
271
+ stub_get('/1.1/lists/subscribers/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
272
+ stub_get('/1.1/lists/subscribers/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '18755393'}).to_return(:body => fixture('not_found.json'), :status => 404, :headers => {:content_type => 'application/json; charset=utf-8'})
273
+ stub_get('/1.1/lists/subscribers/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '12345678'}).to_return(:body => fixture('not_found.json'), :status => 403, :headers => {:content_type => 'application/json; charset=utf-8'})
274
274
  end
275
- it "requests the correct resource" do
276
- @client.list_subscriber?("sferik", "presidents", 813286)
277
- expect(a_get("/1.1/lists/subscribers/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286"})).to have_been_made
275
+ it 'requests the correct resource' do
276
+ @client.list_subscriber?('sferik', 'presidents', 813_286)
277
+ expect(a_get('/1.1/lists/subscribers/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'})).to have_been_made
278
278
  end
279
- it "returns true if the specified user subscribes to the specified list" do
280
- list_subscriber = @client.list_subscriber?("sferik", "presidents", 813286)
279
+ it 'returns true if the specified user subscribes to the specified list' do
280
+ list_subscriber = @client.list_subscriber?('sferik', 'presidents', 813_286)
281
281
  expect(list_subscriber).to be true
282
282
  end
283
- it "returns false if the specified user does not subscribe to the specified list" do
284
- list_subscriber = @client.list_subscriber?("sferik", "presidents", 18755393)
283
+ it 'returns false if the specified user does not subscribe to the specified list' do
284
+ list_subscriber = @client.list_subscriber?('sferik', 'presidents', 18_755_393)
285
285
  expect(list_subscriber).to be false
286
286
  end
287
- it "returns false if user does not exist" do
288
- list_subscriber = @client.list_subscriber?("sferik", "presidents", 12345678)
287
+ it 'returns false if user does not exist' do
288
+ list_subscriber = @client.list_subscriber?('sferik', 'presidents', 12_345_678)
289
289
  expect(list_subscriber).to be false
290
290
  end
291
291
  end
292
- context "with a owner ID passed" do
292
+ context 'with a owner ID passed' do
293
293
  before do
294
- stub_get("/1.1/lists/subscribers/show.json").with(:query => {:owner_id => "12345678", :slug => "presidents", :user_id => "813286"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
294
+ stub_get('/1.1/lists/subscribers/show.json').with(:query => {:owner_id => '12345678', :slug => 'presidents', :user_id => '813286'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
295
295
  end
296
- it "requests the correct resource" do
297
- @client.list_subscriber?(12345678, "presidents", 813286)
298
- expect(a_get("/1.1/lists/subscribers/show.json").with(:query => {:owner_id => "12345678", :slug => "presidents", :user_id => "813286"})).to have_been_made
296
+ it 'requests the correct resource' do
297
+ @client.list_subscriber?(12_345_678, 'presidents', 813_286)
298
+ expect(a_get('/1.1/lists/subscribers/show.json').with(:query => {:owner_id => '12345678', :slug => 'presidents', :user_id => '813286'})).to have_been_made
299
299
  end
300
300
  end
301
- context "with a list ID passed" do
301
+ context 'with a list ID passed' do
302
302
  before do
303
- stub_get("/1.1/lists/subscribers/show.json").with(:query => {:owner_screen_name => "sferik", :list_id => "12345678", :user_id => "813286"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
303
+ stub_get('/1.1/lists/subscribers/show.json').with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678', :user_id => '813286'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
304
304
  end
305
- it "requests the correct resource" do
306
- @client.list_subscriber?("sferik", 12345678, 813286)
307
- expect(a_get("/1.1/lists/subscribers/show.json").with(:query => {:owner_screen_name => "sferik", :list_id => "12345678", :user_id => "813286"})).to have_been_made
305
+ it 'requests the correct resource' do
306
+ @client.list_subscriber?('sferik', 12_345_678, 813_286)
307
+ expect(a_get('/1.1/lists/subscribers/show.json').with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678', :user_id => '813286'})).to have_been_made
308
308
  end
309
309
  end
310
- context "with a list object passed" do
310
+ context 'with a list object passed' do
311
311
  before do
312
- stub_get("/1.1/lists/subscribers/show.json").with(:query => {:owner_id => "7505382", :list_id => "12345678", :user_id => "813286"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
312
+ stub_get('/1.1/lists/subscribers/show.json').with(:query => {:owner_id => '7505382', :list_id => '12345678', :user_id => '813286'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
313
313
  end
314
- it "requests the correct resource" do
315
- list = Twitter::List.new(:id => 12345678, :user => {:id => 7505382, :screen_name => "sferik"})
316
- @client.list_subscriber?(list, 813286)
317
- expect(a_get("/1.1/lists/subscribers/show.json").with(:query => {:owner_id => "7505382", :list_id => "12345678", :user_id => "813286"})).to have_been_made
314
+ it 'requests the correct resource' do
315
+ list = Twitter::List.new(:id => 12_345_678, :user => {:id => 7_505_382, :screen_name => 'sferik'})
316
+ @client.list_subscriber?(list, 813_286)
317
+ expect(a_get('/1.1/lists/subscribers/show.json').with(:query => {:owner_id => '7505382', :list_id => '12345678', :user_id => '813286'})).to have_been_made
318
318
  end
319
319
  end
320
- context "with a screen name passed for user_to_check" do
320
+ context 'with a screen name passed for user_to_check' do
321
321
  before do
322
- stub_get("/1.1/lists/subscribers/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :screen_name => "erebor"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
322
+ stub_get('/1.1/lists/subscribers/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :screen_name => 'erebor'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
323
323
  end
324
- it "requests the correct resource" do
325
- @client.list_subscriber?("sferik", "presidents", "erebor")
326
- expect(a_get("/1.1/lists/subscribers/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :screen_name => "erebor"})).to have_been_made
324
+ it 'requests the correct resource' do
325
+ @client.list_subscriber?('sferik', 'presidents', 'erebor')
326
+ expect(a_get('/1.1/lists/subscribers/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :screen_name => 'erebor'})).to have_been_made
327
327
  end
328
328
  end
329
- context "without a screen name passed" do
329
+ context 'without a screen name passed' do
330
330
  before do
331
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
332
- stub_get("/1.1/lists/subscribers/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
331
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
332
+ stub_get('/1.1/lists/subscribers/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
333
333
  end
334
- it "requests the correct resource" do
335
- @client.list_subscriber?("presidents", 813286)
336
- expect(a_get("/1.1/lists/subscribers/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286"})).to have_been_made
334
+ it 'requests the correct resource' do
335
+ @client.list_subscriber?('presidents', 813_286)
336
+ expect(a_get('/1.1/lists/subscribers/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'})).to have_been_made
337
337
  end
338
338
  end
339
339
  end
340
340
 
341
- describe "#list_unsubscribe" do
342
- context "with a screen name passed" do
341
+ describe '#list_unsubscribe' do
342
+ context 'with a screen name passed' do
343
343
  before do
344
- stub_post("/1.1/lists/subscribers/destroy.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
344
+ stub_post('/1.1/lists/subscribers/destroy.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
345
345
  end
346
- it "requests the correct resource" do
347
- @client.list_unsubscribe("sferik", "presidents")
348
- expect(a_post("/1.1/lists/subscribers/destroy.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents"})).to have_been_made
346
+ it 'requests the correct resource' do
347
+ @client.list_unsubscribe('sferik', 'presidents')
348
+ expect(a_post('/1.1/lists/subscribers/destroy.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'})).to have_been_made
349
349
  end
350
- it "returns the specified list" do
351
- list = @client.list_unsubscribe("sferik", "presidents")
350
+ it 'returns the specified list' do
351
+ list = @client.list_unsubscribe('sferik', 'presidents')
352
352
  expect(list).to be_a Twitter::List
353
- expect(list.name).to eq("presidents")
353
+ expect(list.name).to eq('presidents')
354
354
  end
355
355
  end
356
- context "without a screen name passed" do
356
+ context 'without a screen name passed' do
357
357
  before do
358
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
359
- stub_post("/1.1/lists/subscribers/destroy.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
358
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
359
+ stub_post('/1.1/lists/subscribers/destroy.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
360
360
  end
361
- it "requests the correct resource" do
362
- @client.list_unsubscribe("presidents")
363
- expect(a_post("/1.1/lists/subscribers/destroy.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents"})).to have_been_made
361
+ it 'requests the correct resource' do
362
+ @client.list_unsubscribe('presidents')
363
+ expect(a_post('/1.1/lists/subscribers/destroy.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'})).to have_been_made
364
364
  end
365
365
  end
366
366
  end
367
367
 
368
- describe "#add_list_members" do
369
- context "with a screen name passed" do
368
+ describe '#add_list_members' do
369
+ context 'with a screen name passed' do
370
370
  before do
371
- stub_post("/1.1/lists/members/create_all.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286,18755393"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
371
+ stub_post('/1.1/lists/members/create_all.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286,18755393'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
372
372
  end
373
- it "requests the correct resource" do
374
- @client.add_list_members("sferik", "presidents", [813286, 18755393])
375
- expect(a_post("/1.1/lists/members/create_all.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286,18755393"})).to have_been_made
373
+ it 'requests the correct resource' do
374
+ @client.add_list_members('sferik', 'presidents', [813_286, 18_755_393])
375
+ expect(a_post('/1.1/lists/members/create_all.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286,18755393'})).to have_been_made
376
376
  end
377
- it "returns the list" do
378
- list = @client.add_list_members("sferik", "presidents", [813286, 18755393])
377
+ it 'returns the list' do
378
+ list = @client.add_list_members('sferik', 'presidents', [813_286, 18_755_393])
379
379
  expect(list).to be_a Twitter::List
380
- expect(list.name).to eq("presidents")
380
+ expect(list.name).to eq('presidents')
381
381
  end
382
382
  end
383
- context "with a combination of member IDs and member screen names to add" do
383
+ context 'with a combination of member IDs and member screen names to add' do
384
384
  before do
385
- stub_post("/1.1/lists/members/create_all.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286,18755393", :screen_name => "pengwynn,erebor"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
385
+ stub_post('/1.1/lists/members/create_all.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286,18755393', :screen_name => 'pengwynn,erebor'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
386
386
  end
387
- it "requests the correct resource" do
388
- @client.add_list_members("sferik", "presidents", [813286, "pengwynn", 18755393, "erebor"])
389
- expect(a_post("/1.1/lists/members/create_all.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286,18755393", :screen_name => "pengwynn,erebor"})).to have_been_made
387
+ it 'requests the correct resource' do
388
+ @client.add_list_members('sferik', 'presidents', [813_286, 'pengwynn', 18_755_393, 'erebor'])
389
+ expect(a_post('/1.1/lists/members/create_all.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286,18755393', :screen_name => 'pengwynn,erebor'})).to have_been_made
390
390
  end
391
391
  end
392
- context "without a screen name passed" do
392
+ context 'without a screen name passed' do
393
393
  before do
394
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
395
- stub_post("/1.1/lists/members/create_all.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286,18755393"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
394
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
395
+ stub_post('/1.1/lists/members/create_all.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286,18755393'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
396
396
  end
397
- it "requests the correct resource" do
398
- @client.add_list_members("presidents", [813286, 18755393])
399
- expect(a_post("/1.1/lists/members/create_all.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286,18755393"})).to have_been_made
397
+ it 'requests the correct resource' do
398
+ @client.add_list_members('presidents', [813_286, 18_755_393])
399
+ expect(a_post('/1.1/lists/members/create_all.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286,18755393'})).to have_been_made
400
400
  end
401
401
  end
402
402
  end
403
403
 
404
- describe "#list_member?" do
405
- context "with a screen name passed" do
404
+ describe '#list_member?' do
405
+ context 'with a screen name passed' do
406
406
  before do
407
- stub_get("/1.1/lists/members/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
408
- stub_get("/1.1/lists/members/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "65493023"}).to_return(:body => fixture("not_found.json"), :status => 404, :headers => {:content_type => "application/json; charset=utf-8"})
409
- stub_get("/1.1/lists/members/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "12345678"}).to_return(:body => fixture("not_found.json"), :status => 403, :headers => {:content_type => "application/json; charset=utf-8"})
407
+ stub_get('/1.1/lists/members/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
408
+ stub_get('/1.1/lists/members/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '65493023'}).to_return(:body => fixture('not_found.json'), :status => 404, :headers => {:content_type => 'application/json; charset=utf-8'})
409
+ stub_get('/1.1/lists/members/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '12345678'}).to_return(:body => fixture('not_found.json'), :status => 403, :headers => {:content_type => 'application/json; charset=utf-8'})
410
410
  end
411
- it "requests the correct resource" do
412
- @client.list_member?("sferik", "presidents", 813286)
413
- expect(a_get("/1.1/lists/members/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286"})).to have_been_made
411
+ it 'requests the correct resource' do
412
+ @client.list_member?('sferik', 'presidents', 813_286)
413
+ expect(a_get('/1.1/lists/members/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'})).to have_been_made
414
414
  end
415
- it "returns true if user is a list member" do
416
- list_member = @client.list_member?("sferik", "presidents", 813286)
415
+ it 'returns true if user is a list member' do
416
+ list_member = @client.list_member?('sferik', 'presidents', 813_286)
417
417
  expect(list_member).to be true
418
418
  end
419
- it "returns false if user is not a list member" do
420
- list_member = @client.list_member?("sferik", "presidents", 65493023)
419
+ it 'returns false if user is not a list member' do
420
+ list_member = @client.list_member?('sferik', 'presidents', 65_493_023)
421
421
  expect(list_member).to be false
422
422
  end
423
- it "returns false if user does not exist" do
424
- list_member = @client.list_member?("sferik", "presidents", 12345678)
423
+ it 'returns false if user does not exist' do
424
+ list_member = @client.list_member?('sferik', 'presidents', 12_345_678)
425
425
  expect(list_member).to be false
426
426
  end
427
427
  end
428
- context "with an owner ID passed" do
428
+ context 'with an owner ID passed' do
429
429
  before do
430
- stub_get("/1.1/lists/members/show.json").with(:query => {:owner_id => "12345678", :slug => "presidents", :user_id => "813286"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
430
+ stub_get('/1.1/lists/members/show.json').with(:query => {:owner_id => '12345678', :slug => 'presidents', :user_id => '813286'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
431
431
  end
432
- it "requests the correct resource" do
433
- @client.list_member?(12345678, "presidents", 813286)
434
- expect(a_get("/1.1/lists/members/show.json").with(:query => {:owner_id => "12345678", :slug => "presidents", :user_id => "813286"})).to have_been_made
432
+ it 'requests the correct resource' do
433
+ @client.list_member?(12_345_678, 'presidents', 813_286)
434
+ expect(a_get('/1.1/lists/members/show.json').with(:query => {:owner_id => '12345678', :slug => 'presidents', :user_id => '813286'})).to have_been_made
435
435
  end
436
436
  end
437
- context "with a list ID passed" do
437
+ context 'with a list ID passed' do
438
438
  before do
439
- stub_get("/1.1/lists/members/show.json").with(:query => {:owner_screen_name => "sferik", :list_id => "12345678", :user_id => "813286"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
439
+ stub_get('/1.1/lists/members/show.json').with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678', :user_id => '813286'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
440
440
  end
441
- it "requests the correct resource" do
442
- @client.list_member?("sferik", 12345678, 813286)
443
- expect(a_get("/1.1/lists/members/show.json").with(:query => {:owner_screen_name => "sferik", :list_id => "12345678", :user_id => "813286"})).to have_been_made
441
+ it 'requests the correct resource' do
442
+ @client.list_member?('sferik', 12_345_678, 813_286)
443
+ expect(a_get('/1.1/lists/members/show.json').with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678', :user_id => '813286'})).to have_been_made
444
444
  end
445
445
  end
446
- context "with a list object passed" do
446
+ context 'with a list object passed' do
447
447
  before do
448
- stub_get("/1.1/lists/members/show.json").with(:query => {:owner_id => "7505382", :list_id => "12345678", :user_id => "813286"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
448
+ stub_get('/1.1/lists/members/show.json').with(:query => {:owner_id => '7505382', :list_id => '12345678', :user_id => '813286'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
449
449
  end
450
- it "requests the correct resource" do
451
- list = Twitter::List.new(:id => 12345678, :user => {:id => 7505382, :screen_name => "sferik"})
452
- @client.list_member?(list, 813286)
453
- expect(a_get("/1.1/lists/members/show.json").with(:query => {:owner_id => "7505382", :list_id => "12345678", :user_id => "813286"})).to have_been_made
450
+ it 'requests the correct resource' do
451
+ list = Twitter::List.new(:id => 12_345_678, :user => {:id => 7_505_382, :screen_name => 'sferik'})
452
+ @client.list_member?(list, 813_286)
453
+ expect(a_get('/1.1/lists/members/show.json').with(:query => {:owner_id => '7505382', :list_id => '12345678', :user_id => '813286'})).to have_been_made
454
454
  end
455
455
  end
456
- context "with a screen name passed for user_to_check" do
456
+ context 'with a screen name passed for user_to_check' do
457
457
  before do
458
- stub_get("/1.1/lists/members/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :screen_name => "erebor"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/.json; charset=utf-8"})
458
+ stub_get('/1.1/lists/members/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :screen_name => 'erebor'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/.json; charset=utf-8'})
459
459
  end
460
- it "requests the correct resource" do
461
- @client.list_member?("sferik", "presidents", "erebor")
462
- expect(a_get("/1.1/lists/members/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :screen_name => "erebor"})).to have_been_made
460
+ it 'requests the correct resource' do
461
+ @client.list_member?('sferik', 'presidents', 'erebor')
462
+ expect(a_get('/1.1/lists/members/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :screen_name => 'erebor'})).to have_been_made
463
463
  end
464
464
  end
465
- context "without a screen name passed" do
465
+ context 'without a screen name passed' do
466
466
  before do
467
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
468
- stub_get("/1.1/lists/members/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/.json; charset=utf-8"})
467
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
468
+ stub_get('/1.1/lists/members/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/.json; charset=utf-8'})
469
469
  end
470
- it "requests the correct resource" do
471
- @client.list_member?("presidents", 813286)
472
- expect(a_get("/1.1/lists/members/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286"})).to have_been_made
470
+ it 'requests the correct resource' do
471
+ @client.list_member?('presidents', 813_286)
472
+ expect(a_get('/1.1/lists/members/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'})).to have_been_made
473
473
  end
474
474
  end
475
475
  end
476
476
 
477
- describe "#list_members" do
478
- context "with a screen name passed" do
477
+ describe '#list_members' do
478
+ context 'with a screen name passed' do
479
479
  before do
480
- stub_get("/1.1/lists/members.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "-1"}).to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
480
+ stub_get('/1.1/lists/members.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '-1'}).to_return(:body => fixture('users_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
481
481
  end
482
- it "requests the correct resource" do
483
- @client.list_members("sferik", "presidents")
484
- expect(a_get("/1.1/lists/members.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "-1"})).to have_been_made
482
+ it 'requests the correct resource' do
483
+ @client.list_members('sferik', 'presidents')
484
+ expect(a_get('/1.1/lists/members.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '-1'})).to have_been_made
485
485
  end
486
- it "returns the members of the specified list" do
487
- list_members = @client.list_members("sferik", "presidents")
486
+ it 'returns the members of the specified list' do
487
+ list_members = @client.list_members('sferik', 'presidents')
488
488
  expect(list_members).to be_a Twitter::Cursor
489
489
  expect(list_members.first).to be_a Twitter::User
490
- expect(list_members.first.id).to eq(7505382)
490
+ expect(list_members.first.id).to eq(7_505_382)
491
491
  end
492
- context "with each" do
492
+ context 'with each' do
493
493
  before do
494
- stub_get("/1.1/lists/members.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "1322801608223717003"}).to_return(:body => fixture("users_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
494
+ stub_get('/1.1/lists/members.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '1322801608223717003'}).to_return(:body => fixture('users_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
495
495
  end
496
- it "requests the correct resource" do
497
- @client.list_members("sferik", "presidents").each{}
498
- expect(a_get("/1.1/lists/members.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "-1"})).to have_been_made
499
- expect(a_get("/1.1/lists/members.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "1322801608223717003"})).to have_been_made
496
+ it 'requests the correct resource' do
497
+ @client.list_members('sferik', 'presidents').each {}
498
+ expect(a_get('/1.1/lists/members.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '-1'})).to have_been_made
499
+ expect(a_get('/1.1/lists/members.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '1322801608223717003'})).to have_been_made
500
500
  end
501
501
  end
502
502
  end
503
- context "with a user ID passed" do
503
+ context 'with a user ID passed' do
504
504
  before do
505
- stub_get("/1.1/lists/members.json").with(:query => {:owner_id => "7505382", :slug => "presidents", :cursor => "-1"}).to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
505
+ stub_get('/1.1/lists/members.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '-1'}).to_return(:body => fixture('users_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
506
506
  end
507
- it "requests the correct resource" do
508
- @client.list_members(7505382, "presidents")
509
- expect(a_get("/1.1/lists/members.json").with(:query => {:owner_id => "7505382", :slug => "presidents", :cursor => "-1"})).to have_been_made
507
+ it 'requests the correct resource' do
508
+ @client.list_members(7_505_382, 'presidents')
509
+ expect(a_get('/1.1/lists/members.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '-1'})).to have_been_made
510
510
  end
511
- context "with each" do
511
+ context 'with each' do
512
512
  before do
513
- stub_get("/1.1/lists/members.json").with(:query => {:owner_id => "7505382", :slug => "presidents", :cursor => "1322801608223717003"}).to_return(:body => fixture("users_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
513
+ stub_get('/1.1/lists/members.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '1322801608223717003'}).to_return(:body => fixture('users_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
514
514
  end
515
- it "requests the correct resource" do
516
- @client.list_members(7505382, "presidents").each{}
517
- expect(a_get("/1.1/lists/members.json").with(:query => {:owner_id => "7505382", :slug => "presidents", :cursor => "-1"})).to have_been_made
518
- expect(a_get("/1.1/lists/members.json").with(:query => {:owner_id => "7505382", :slug => "presidents", :cursor => "1322801608223717003"})).to have_been_made
515
+ it 'requests the correct resource' do
516
+ @client.list_members(7_505_382, 'presidents').each {}
517
+ expect(a_get('/1.1/lists/members.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '-1'})).to have_been_made
518
+ expect(a_get('/1.1/lists/members.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '1322801608223717003'})).to have_been_made
519
519
  end
520
520
  end
521
521
  end
522
- context "without a screen name passed" do
522
+ context 'without a screen name passed' do
523
523
  before do
524
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
525
- stub_get("/1.1/lists/members.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "-1"}).to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
524
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
525
+ stub_get('/1.1/lists/members.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '-1'}).to_return(:body => fixture('users_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
526
526
  end
527
- it "requests the correct resource" do
528
- @client.list_members("presidents")
529
- expect(a_get("/1.1/lists/members.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "-1"})).to have_been_made
527
+ it 'requests the correct resource' do
528
+ @client.list_members('presidents')
529
+ expect(a_get('/1.1/lists/members.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '-1'})).to have_been_made
530
530
  end
531
- context "with each" do
531
+ context 'with each' do
532
532
  before do
533
- stub_get("/1.1/lists/members.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "1322801608223717003"}).to_return(:body => fixture("users_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
533
+ stub_get('/1.1/lists/members.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '1322801608223717003'}).to_return(:body => fixture('users_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
534
534
  end
535
- it "requests the correct resource" do
536
- @client.list_members("presidents").each{}
537
- expect(a_get("/1.1/lists/members.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "-1"})).to have_been_made
538
- expect(a_get("/1.1/lists/members.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents", :cursor => "1322801608223717003"})).to have_been_made
535
+ it 'requests the correct resource' do
536
+ @client.list_members('presidents').each {}
537
+ expect(a_get('/1.1/lists/members.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '-1'})).to have_been_made
538
+ expect(a_get('/1.1/lists/members.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => '1322801608223717003'})).to have_been_made
539
539
  end
540
540
  end
541
541
  end
542
542
  end
543
543
 
544
- describe "#add_list_member" do
545
- context "with a screen name passed" do
544
+ describe '#add_list_member' do
545
+ context 'with a screen name passed' do
546
546
  before do
547
- stub_post("/1.1/lists/members/create.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
547
+ stub_post('/1.1/lists/members/create.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
548
548
  end
549
- it "requests the correct resource" do
550
- @client.add_list_member("sferik", "presidents", 813286)
551
- expect(a_post("/1.1/lists/members/create.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286"})).to have_been_made
549
+ it 'requests the correct resource' do
550
+ @client.add_list_member('sferik', 'presidents', 813_286)
551
+ expect(a_post('/1.1/lists/members/create.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'})).to have_been_made
552
552
  end
553
- it "returns the list" do
554
- list = @client.add_list_member("sferik", "presidents", 813286)
553
+ it 'returns the list' do
554
+ list = @client.add_list_member('sferik', 'presidents', 813_286)
555
555
  expect(list).to be_a Twitter::List
556
- expect(list.name).to eq("presidents")
556
+ expect(list.name).to eq('presidents')
557
557
  end
558
558
  end
559
- context "without a screen name passed" do
559
+ context 'without a screen name passed' do
560
560
  before do
561
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
562
- stub_post("/1.1/lists/members/create.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
561
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
562
+ stub_post('/1.1/lists/members/create.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
563
563
  end
564
- it "requests the correct resource" do
565
- @client.add_list_member("presidents", 813286)
566
- expect(a_post("/1.1/lists/members/create.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286"})).to have_been_made
564
+ it 'requests the correct resource' do
565
+ @client.add_list_member('presidents', 813_286)
566
+ expect(a_post('/1.1/lists/members/create.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'})).to have_been_made
567
567
  end
568
568
  end
569
569
  end
570
570
 
571
- describe "#destroy_list" do
572
- context "with a screen name passed" do
571
+ describe '#destroy_list' do
572
+ context 'with a screen name passed' do
573
573
  before do
574
- stub_post("/1.1/lists/destroy.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
574
+ stub_post('/1.1/lists/destroy.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
575
575
  end
576
- it "requests the correct resource" do
577
- @client.destroy_list("sferik", "presidents")
578
- expect(a_post("/1.1/lists/destroy.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents"})).to have_been_made
576
+ it 'requests the correct resource' do
577
+ @client.destroy_list('sferik', 'presidents')
578
+ expect(a_post('/1.1/lists/destroy.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'})).to have_been_made
579
579
  end
580
- it "returns the deleted list" do
581
- list = @client.destroy_list("sferik", "presidents")
580
+ it 'returns the deleted list' do
581
+ list = @client.destroy_list('sferik', 'presidents')
582
582
  expect(list).to be_a Twitter::List
583
- expect(list.name).to eq("presidents")
583
+ expect(list.name).to eq('presidents')
584
584
  end
585
585
  end
586
- context "without a screen name passed" do
586
+ context 'without a screen name passed' do
587
587
  before do
588
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
589
- stub_post("/1.1/lists/destroy.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
588
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
589
+ stub_post('/1.1/lists/destroy.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
590
590
  end
591
- it "requests the correct resource" do
592
- @client.destroy_list("presidents")
593
- expect(a_post("/1.1/lists/destroy.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents"})).to have_been_made
591
+ it 'requests the correct resource' do
592
+ @client.destroy_list('presidents')
593
+ expect(a_post('/1.1/lists/destroy.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'})).to have_been_made
594
594
  end
595
595
  end
596
- context "with a list ID passed" do
596
+ context 'with a list ID passed' do
597
597
  before do
598
- stub_post("/1.1/lists/destroy.json").with(:body => {:owner_screen_name => "sferik", :list_id => "12345678"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
598
+ stub_post('/1.1/lists/destroy.json').with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
599
599
  end
600
- it "requests the correct resource" do
601
- @client.destroy_list("sferik", 12345678)
602
- expect(a_post("/1.1/lists/destroy.json").with(:body => {:owner_screen_name => "sferik", :list_id => "12345678"})).to have_been_made
600
+ it 'requests the correct resource' do
601
+ @client.destroy_list('sferik', 12_345_678)
602
+ expect(a_post('/1.1/lists/destroy.json').with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678'})).to have_been_made
603
603
  end
604
604
  end
605
- context "with a list object passed" do
605
+ context 'with a list object passed' do
606
606
  before do
607
- stub_post("/1.1/lists/destroy.json").with(:body => {:owner_id => "7505382", :list_id => "12345678"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
607
+ stub_post('/1.1/lists/destroy.json').with(:body => {:owner_id => '7505382', :list_id => '12345678'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
608
608
  end
609
- it "requests the correct resource" do
610
- list = Twitter::List.new(:id => "12345678", :user => {:id => 7505382, :screen_name => "sferik"})
609
+ it 'requests the correct resource' do
610
+ list = Twitter::List.new(:id => '12345678', :user => {:id => 7_505_382, :screen_name => 'sferik'})
611
611
  @client.destroy_list(list)
612
- expect(a_post("/1.1/lists/destroy.json").with(:body => {:owner_id => "7505382", :list_id => "12345678"})).to have_been_made
612
+ expect(a_post('/1.1/lists/destroy.json').with(:body => {:owner_id => '7505382', :list_id => '12345678'})).to have_been_made
613
613
  end
614
614
  end
615
615
  end
616
616
 
617
- describe "#list_update" do
618
- context "with a screen name passed" do
617
+ describe '#list_update' do
618
+ context 'with a screen name passed' do
619
619
  before do
620
- stub_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :description => "Presidents of the United States of America"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
620
+ stub_post('/1.1/lists/update.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :description => 'Presidents of the United States of America'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
621
621
  end
622
- it "requests the correct resource" do
623
- @client.list_update("sferik", "presidents", :description => "Presidents of the United States of America")
624
- expect(a_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :description => "Presidents of the United States of America"})).to have_been_made
622
+ it 'requests the correct resource' do
623
+ @client.list_update('sferik', 'presidents', :description => 'Presidents of the United States of America')
624
+ expect(a_post('/1.1/lists/update.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :description => 'Presidents of the United States of America'})).to have_been_made
625
625
  end
626
- it "returns the updated list" do
627
- list = @client.list_update("sferik", "presidents", :description => "Presidents of the United States of America")
626
+ it 'returns the updated list' do
627
+ list = @client.list_update('sferik', 'presidents', :description => 'Presidents of the United States of America')
628
628
  expect(list).to be_a Twitter::List
629
- expect(list.name).to eq("presidents")
629
+ expect(list.name).to eq('presidents')
630
630
  end
631
631
  end
632
- context "without a screen name passed" do
632
+ context 'without a screen name passed' do
633
633
  before do
634
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
635
- stub_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :description => "Presidents of the United States of America"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
634
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
635
+ stub_post('/1.1/lists/update.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :description => 'Presidents of the United States of America'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
636
636
  end
637
- it "requests the correct resource" do
638
- @client.list_update("presidents", :description => "Presidents of the United States of America")
639
- expect(a_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :description => "Presidents of the United States of America"})).to have_been_made
637
+ it 'requests the correct resource' do
638
+ @client.list_update('presidents', :description => 'Presidents of the United States of America')
639
+ expect(a_post('/1.1/lists/update.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :description => 'Presidents of the United States of America'})).to have_been_made
640
640
  end
641
641
  end
642
- context "with a list ID passed" do
642
+ context 'with a list ID passed' do
643
643
  before do
644
- stub_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :list_id => "12345678", :description => "Presidents of the United States of America"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
644
+ stub_post('/1.1/lists/update.json').with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678', :description => 'Presidents of the United States of America'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
645
645
  end
646
- it "requests the correct resource" do
647
- @client.list_update("sferik", 12345678, :description => "Presidents of the United States of America")
648
- expect(a_post("/1.1/lists/update.json").with(:body => {:owner_screen_name => "sferik", :list_id => "12345678", :description => "Presidents of the United States of America"})).to have_been_made
646
+ it 'requests the correct resource' do
647
+ @client.list_update('sferik', 12_345_678, :description => 'Presidents of the United States of America')
648
+ expect(a_post('/1.1/lists/update.json').with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678', :description => 'Presidents of the United States of America'})).to have_been_made
649
649
  end
650
650
  end
651
- context "with a list object passed" do
651
+ context 'with a list object passed' do
652
652
  before do
653
- stub_post("/1.1/lists/update.json").with(:body => {:owner_id => "7505382", :list_id => "12345678", :description => "Presidents of the United States of America"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
653
+ stub_post('/1.1/lists/update.json').with(:body => {:owner_id => '7505382', :list_id => '12345678', :description => 'Presidents of the United States of America'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
654
654
  end
655
- it "requests the correct resource" do
656
- list = Twitter::List.new(:id => "12345678", :user => {:id => 7505382, :screen_name => "sferik"})
657
- @client.list_update(list, :description => "Presidents of the United States of America")
658
- expect(a_post("/1.1/lists/update.json").with(:body => {:owner_id => "7505382", :list_id => "12345678", :description => "Presidents of the United States of America"})).to have_been_made
655
+ it 'requests the correct resource' do
656
+ list = Twitter::List.new(:id => '12345678', :user => {:id => 7_505_382, :screen_name => 'sferik'})
657
+ @client.list_update(list, :description => 'Presidents of the United States of America')
658
+ expect(a_post('/1.1/lists/update.json').with(:body => {:owner_id => '7505382', :list_id => '12345678', :description => 'Presidents of the United States of America'})).to have_been_made
659
659
  end
660
660
  end
661
661
  end
662
662
 
663
- describe "#create_list" do
663
+ describe '#create_list' do
664
664
  before do
665
- stub_post("/1.1/lists/create.json").with(:body => {:name => "presidents"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
665
+ stub_post('/1.1/lists/create.json').with(:body => {:name => 'presidents'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
666
666
  end
667
- it "requests the correct resource" do
668
- @client.create_list("presidents")
669
- expect(a_post("/1.1/lists/create.json").with(:body => {:name => "presidents"})).to have_been_made
667
+ it 'requests the correct resource' do
668
+ @client.create_list('presidents')
669
+ expect(a_post('/1.1/lists/create.json').with(:body => {:name => 'presidents'})).to have_been_made
670
670
  end
671
- it "returns the created list" do
672
- list = @client.create_list("presidents")
671
+ it 'returns the created list' do
672
+ list = @client.create_list('presidents')
673
673
  expect(list).to be_a Twitter::List
674
- expect(list.name).to eq("presidents")
674
+ expect(list.name).to eq('presidents')
675
675
  end
676
676
  end
677
677
 
678
- describe "#list" do
679
- context "with a screen name passed" do
678
+ describe '#list' do
679
+ context 'with a screen name passed' do
680
680
  before do
681
- stub_get("/1.1/lists/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
681
+ stub_get('/1.1/lists/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
682
682
  end
683
- it "requests the correct resource" do
684
- @client.list("sferik", "presidents")
685
- expect(a_get("/1.1/lists/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents"})).to have_been_made
683
+ it 'requests the correct resource' do
684
+ @client.list('sferik', 'presidents')
685
+ expect(a_get('/1.1/lists/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'})).to have_been_made
686
686
  end
687
- it "returns the updated list" do
688
- list = @client.list("sferik", "presidents")
687
+ it 'returns the updated list' do
688
+ list = @client.list('sferik', 'presidents')
689
689
  expect(list).to be_a Twitter::List
690
- expect(list.name).to eq("presidents")
690
+ expect(list.name).to eq('presidents')
691
691
  end
692
692
  end
693
- context "with a user ID passed" do
693
+ context 'with a user ID passed' do
694
694
  before do
695
- stub_get("/1.1/lists/show.json").with(:query => {:owner_id => "12345678", :slug => "presidents"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
695
+ stub_get('/1.1/lists/show.json').with(:query => {:owner_id => '12345678', :slug => 'presidents'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
696
696
  end
697
- it "requests the correct resource" do
698
- @client.list(12345678, "presidents")
699
- expect(a_get("/1.1/lists/show.json").with(:query => {:owner_id => "12345678", :slug => "presidents"})).to have_been_made
697
+ it 'requests the correct resource' do
698
+ @client.list(12_345_678, 'presidents')
699
+ expect(a_get('/1.1/lists/show.json').with(:query => {:owner_id => '12345678', :slug => 'presidents'})).to have_been_made
700
700
  end
701
701
  end
702
- context "with a user object passed" do
702
+ context 'with a user object passed' do
703
703
  before do
704
- stub_get("/1.1/lists/show.json").with(:query => {:owner_id => "12345678", :slug => "presidents"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
704
+ stub_get('/1.1/lists/show.json').with(:query => {:owner_id => '12345678', :slug => 'presidents'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
705
705
  end
706
- it "requests the correct resource" do
707
- user = Twitter::User.new(:id => "12345678")
708
- @client.list(user, "presidents")
709
- expect(a_get("/1.1/lists/show.json").with(:query => {:owner_id => "12345678", :slug => "presidents"})).to have_been_made
706
+ it 'requests the correct resource' do
707
+ user = Twitter::User.new(:id => '12345678')
708
+ @client.list(user, 'presidents')
709
+ expect(a_get('/1.1/lists/show.json').with(:query => {:owner_id => '12345678', :slug => 'presidents'})).to have_been_made
710
710
  end
711
711
  end
712
- context "without a screen name passed" do
712
+ context 'without a screen name passed' do
713
713
  before do
714
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
715
- stub_get("/1.1/lists/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
714
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
715
+ stub_get('/1.1/lists/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
716
716
  end
717
- it "requests the correct resource" do
718
- @client.list("presidents")
719
- expect(a_get("/1.1/lists/show.json").with(:query => {:owner_screen_name => "sferik", :slug => "presidents"})).to have_been_made
717
+ it 'requests the correct resource' do
718
+ @client.list('presidents')
719
+ expect(a_get('/1.1/lists/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'})).to have_been_made
720
720
  end
721
721
  end
722
- context "with a list ID passed" do
722
+ context 'with a list ID passed' do
723
723
  before do
724
- stub_get("/1.1/lists/show.json").with(:query => {:owner_screen_name => "sferik", :list_id => "12345678"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
724
+ stub_get('/1.1/lists/show.json').with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
725
725
  end
726
- it "requests the correct resource" do
727
- @client.list("sferik", 12345678)
728
- expect(a_get("/1.1/lists/show.json").with(:query => {:owner_screen_name => "sferik", :list_id => "12345678"})).to have_been_made
726
+ it 'requests the correct resource' do
727
+ @client.list('sferik', 12_345_678)
728
+ expect(a_get('/1.1/lists/show.json').with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678'})).to have_been_made
729
729
  end
730
730
  end
731
- context "with a list object passed" do
731
+ context 'with a list object passed' do
732
732
  before do
733
- stub_get("/1.1/lists/show.json").with(:query => {:owner_id => "7505382", :list_id => "12345678"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
733
+ stub_get('/1.1/lists/show.json').with(:query => {:owner_id => '7505382', :list_id => '12345678'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
734
734
  end
735
- it "requests the correct resource" do
736
- list = Twitter::List.new(:id => "12345678", :user => {:id => 7505382, :screen_name => "sferik"})
735
+ it 'requests the correct resource' do
736
+ list = Twitter::List.new(:id => '12345678', :user => {:id => 7_505_382, :screen_name => 'sferik'})
737
737
  @client.list(list)
738
- expect(a_get("/1.1/lists/show.json").with(:query => {:owner_id => "7505382", :list_id => "12345678"})).to have_been_made
738
+ expect(a_get('/1.1/lists/show.json').with(:query => {:owner_id => '7505382', :list_id => '12345678'})).to have_been_made
739
739
  end
740
740
  end
741
741
  end
742
742
 
743
- describe "#subscriptions" do
744
- context "with a screen name passed" do
743
+ describe '#subscriptions' do
744
+ context 'with a screen name passed' do
745
745
  before do
746
- stub_get("/1.1/lists/subscriptions.json").with(:query => {:screen_name => "sferik", :cursor => "-1"}).to_return(:body => fixture("subscriptions.json"), :headers => {:content_type => "application/json; charset=utf-8"})
746
+ stub_get('/1.1/lists/subscriptions.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'}).to_return(:body => fixture('subscriptions.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
747
747
  end
748
- it "requests the correct resource" do
749
- @client.subscriptions("sferik")
750
- expect(a_get("/1.1/lists/subscriptions.json").with(:query => {:screen_name => "sferik", :cursor => "-1"})).to have_been_made
748
+ it 'requests the correct resource' do
749
+ @client.subscriptions('sferik')
750
+ expect(a_get('/1.1/lists/subscriptions.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
751
751
  end
752
- it "returns the lists the specified user follows" do
753
- subscriptions = @client.subscriptions("sferik")
752
+ it 'returns the lists the specified user follows' do
753
+ subscriptions = @client.subscriptions('sferik')
754
754
  expect(subscriptions).to be_a Twitter::Cursor
755
755
  expect(subscriptions.first).to be_a Twitter::List
756
- expect(subscriptions.first.name).to eq("Rubyists")
756
+ expect(subscriptions.first.name).to eq('Rubyists')
757
757
  end
758
- context "with each" do
758
+ context 'with each' do
759
759
  before do
760
- stub_get("/1.1/lists/subscriptions.json").with(:query => {:screen_name => "sferik", :cursor => "1401037770457540712"}).to_return(:body => fixture("subscriptions2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
760
+ stub_get('/1.1/lists/subscriptions.json').with(:query => {:screen_name => 'sferik', :cursor => '1401037770457540712'}).to_return(:body => fixture('subscriptions2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
761
761
  end
762
- it "requests the correct resource" do
763
- @client.subscriptions("sferik").each{}
764
- expect(a_get("/1.1/lists/subscriptions.json").with(:query => {:screen_name => "sferik", :cursor => "-1"})).to have_been_made
765
- expect(a_get("/1.1/lists/subscriptions.json").with(:query => {:screen_name => "sferik", :cursor => "1401037770457540712"})).to have_been_made
762
+ it 'requests the correct resource' do
763
+ @client.subscriptions('sferik').each {}
764
+ expect(a_get('/1.1/lists/subscriptions.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
765
+ expect(a_get('/1.1/lists/subscriptions.json').with(:query => {:screen_name => 'sferik', :cursor => '1401037770457540712'})).to have_been_made
766
766
  end
767
767
  end
768
768
  end
769
- context "with a user ID passed" do
769
+ context 'with a user ID passed' do
770
770
  before do
771
- stub_get("/1.1/lists/subscriptions.json").with(:query => {:user_id => "7505382", :cursor => "-1"}).to_return(:body => fixture("subscriptions.json"), :headers => {:content_type => "application/json; charset=utf-8"})
771
+ stub_get('/1.1/lists/subscriptions.json').with(:query => {:user_id => '7505382', :cursor => '-1'}).to_return(:body => fixture('subscriptions.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
772
772
  end
773
- it "requests the correct resource" do
774
- @client.subscriptions(7505382)
775
- expect(a_get("/1.1/lists/subscriptions.json").with(:query => {:user_id => "7505382", :cursor => "-1"})).to have_been_made
773
+ it 'requests the correct resource' do
774
+ @client.subscriptions(7_505_382)
775
+ expect(a_get('/1.1/lists/subscriptions.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
776
776
  end
777
- context "with each" do
777
+ context 'with each' do
778
778
  before do
779
- stub_get("/1.1/lists/subscriptions.json").with(:query => {:user_id => "7505382", :cursor => "1401037770457540712"}).to_return(:body => fixture("subscriptions2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
779
+ stub_get('/1.1/lists/subscriptions.json').with(:query => {:user_id => '7505382', :cursor => '1401037770457540712'}).to_return(:body => fixture('subscriptions2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
780
780
  end
781
- it "requests the correct resource" do
782
- @client.subscriptions(7505382).each{}
783
- expect(a_get("/1.1/lists/subscriptions.json").with(:query => {:user_id => "7505382", :cursor => "-1"})).to have_been_made
784
- expect(a_get("/1.1/lists/subscriptions.json").with(:query => {:user_id => "7505382", :cursor => "1401037770457540712"})).to have_been_made
781
+ it 'requests the correct resource' do
782
+ @client.subscriptions(7_505_382).each {}
783
+ expect(a_get('/1.1/lists/subscriptions.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
784
+ expect(a_get('/1.1/lists/subscriptions.json').with(:query => {:user_id => '7505382', :cursor => '1401037770457540712'})).to have_been_made
785
785
  end
786
786
  end
787
787
  end
788
- context "without a screen name passed" do
788
+ context 'without a screen name passed' do
789
789
  before do
790
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
791
- stub_get("/1.1/lists/subscriptions.json").with(:query => {:screen_name => "sferik", :cursor => "-1"}).to_return(:body => fixture("subscriptions.json"), :headers => {:content_type => "application/json; charset=utf-8"})
790
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
791
+ stub_get('/1.1/lists/subscriptions.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'}).to_return(:body => fixture('subscriptions.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
792
792
  end
793
- it "requests the correct resource" do
793
+ it 'requests the correct resource' do
794
794
  @client.subscriptions
795
- expect(a_get("/1.1/lists/subscriptions.json").with(:query => {:screen_name => "sferik", :cursor => "-1"})).to have_been_made
795
+ expect(a_get('/1.1/lists/subscriptions.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
796
796
  end
797
- context "with each" do
797
+ context 'with each' do
798
798
  before do
799
- stub_get("/1.1/lists/subscriptions.json").with(:query => {:screen_name => "sferik", :cursor => "1401037770457540712"}).to_return(:body => fixture("subscriptions2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
799
+ stub_get('/1.1/lists/subscriptions.json').with(:query => {:screen_name => 'sferik', :cursor => '1401037770457540712'}).to_return(:body => fixture('subscriptions2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
800
800
  end
801
- it "requests the correct resource" do
802
- @client.subscriptions.each{}
803
- expect(a_get("/1.1/lists/subscriptions.json").with(:query => {:screen_name => "sferik", :cursor => "-1"})).to have_been_made
804
- expect(a_get("/1.1/lists/subscriptions.json").with(:query => {:screen_name => "sferik", :cursor => "1401037770457540712"})).to have_been_made
801
+ it 'requests the correct resource' do
802
+ @client.subscriptions.each {}
803
+ expect(a_get('/1.1/lists/subscriptions.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
804
+ expect(a_get('/1.1/lists/subscriptions.json').with(:query => {:screen_name => 'sferik', :cursor => '1401037770457540712'})).to have_been_made
805
805
  end
806
806
  end
807
807
  end
808
808
  end
809
809
 
810
- describe "#remove_list_members" do
811
- context "with a screen name passed" do
810
+ describe '#remove_list_members' do
811
+ context 'with a screen name passed' do
812
812
  before do
813
- stub_post("/1.1/lists/members/destroy_all.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286,18755393"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
813
+ stub_post('/1.1/lists/members/destroy_all.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286,18755393'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
814
814
  end
815
- it "requests the correct resource" do
816
- @client.remove_list_members("sferik", "presidents", [813286, 18755393])
817
- expect(a_post("/1.1/lists/members/destroy_all.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286,18755393"})).to have_been_made
815
+ it 'requests the correct resource' do
816
+ @client.remove_list_members('sferik', 'presidents', [813_286, 18_755_393])
817
+ expect(a_post('/1.1/lists/members/destroy_all.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286,18755393'})).to have_been_made
818
818
  end
819
- it "returns the list" do
820
- list = @client.remove_list_members("sferik", "presidents", [813286, 18755393])
819
+ it 'returns the list' do
820
+ list = @client.remove_list_members('sferik', 'presidents', [813_286, 18_755_393])
821
821
  expect(list).to be_a Twitter::List
822
- expect(list.name).to eq("presidents")
822
+ expect(list.name).to eq('presidents')
823
823
  end
824
824
  end
825
- context "with a user ID passed" do
825
+ context 'with a user ID passed' do
826
826
  before do
827
- stub_post("/1.1/lists/members/destroy_all.json").with(:body => {:owner_id => "7505382", :slug => "presidents", :user_id => "813286,18755393"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
827
+ stub_post('/1.1/lists/members/destroy_all.json').with(:body => {:owner_id => '7505382', :slug => 'presidents', :user_id => '813286,18755393'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
828
828
  end
829
- it "requests the correct resource" do
830
- @client.remove_list_members(7505382, "presidents", [813286, 18755393])
831
- expect(a_post("/1.1/lists/members/destroy_all.json").with(:body => {:owner_id => "7505382", :slug => "presidents", :user_id => "813286,18755393"})).to have_been_made
829
+ it 'requests the correct resource' do
830
+ @client.remove_list_members(7_505_382, 'presidents', [813_286, 18_755_393])
831
+ expect(a_post('/1.1/lists/members/destroy_all.json').with(:body => {:owner_id => '7505382', :slug => 'presidents', :user_id => '813286,18755393'})).to have_been_made
832
832
  end
833
833
  end
834
- context "with a combination of member IDs and member screen names to add" do
834
+ context 'with a combination of member IDs and member screen names to add' do
835
835
  before do
836
- stub_post("/1.1/lists/members/destroy_all.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286,18755393", :screen_name => "pengwynn,erebor"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
836
+ stub_post('/1.1/lists/members/destroy_all.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286,18755393', :screen_name => 'pengwynn,erebor'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
837
837
  end
838
- it "requests the correct resource" do
839
- @client.remove_list_members("sferik", "presidents", [813286, "pengwynn", 18755393, "erebor"])
840
- expect(a_post("/1.1/lists/members/destroy_all.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286,18755393", :screen_name => "pengwynn,erebor"})).to have_been_made
838
+ it 'requests the correct resource' do
839
+ @client.remove_list_members('sferik', 'presidents', [813_286, 'pengwynn', 18_755_393, 'erebor'])
840
+ expect(a_post('/1.1/lists/members/destroy_all.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286,18755393', :screen_name => 'pengwynn,erebor'})).to have_been_made
841
841
  end
842
842
  end
843
- context "without a screen name passed" do
843
+ context 'without a screen name passed' do
844
844
  before do
845
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
846
- stub_post("/1.1/lists/members/destroy_all.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286,18755393"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
845
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
846
+ stub_post('/1.1/lists/members/destroy_all.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286,18755393'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
847
847
  end
848
- it "requests the correct resource" do
849
- @client.remove_list_members("presidents", [813286, 18755393])
850
- expect(a_post("/1.1/lists/members/destroy_all.json").with(:body => {:owner_screen_name => "sferik", :slug => "presidents", :user_id => "813286,18755393"})).to have_been_made
848
+ it 'requests the correct resource' do
849
+ @client.remove_list_members('presidents', [813_286, 18_755_393])
850
+ expect(a_post('/1.1/lists/members/destroy_all.json').with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286,18755393'})).to have_been_made
851
851
  end
852
852
  end
853
853
  end
854
854
 
855
- describe "#owned_lists" do
856
- context "with a screen name passed" do
855
+ describe '#owned_lists' do
856
+ context 'with a screen name passed' do
857
857
  before do
858
- stub_get("/1.1/lists/ownerships.json").with(:query => {:screen_name => "sferik", :cursor => "-1"}).to_return(:body => fixture("ownerships.json"), :headers => {:content_type => "application/json; charset=utf-8"})
858
+ stub_get('/1.1/lists/ownerships.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'}).to_return(:body => fixture('ownerships.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
859
859
  end
860
- it "requests the correct resource" do
861
- @client.owned_lists("sferik")
862
- expect(a_get("/1.1/lists/ownerships.json").with(:query => {:screen_name => "sferik", :cursor => "-1"})).to have_been_made
860
+ it 'requests the correct resource' do
861
+ @client.owned_lists('sferik')
862
+ expect(a_get('/1.1/lists/ownerships.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
863
863
  end
864
- it "returns the requested list" do
865
- lists = @client.owned_lists("sferik")
864
+ it 'returns the requested list' do
865
+ lists = @client.owned_lists('sferik')
866
866
  expect(lists).to be_a Twitter::Cursor
867
867
  expect(lists.first).to be_a Twitter::List
868
- expect(lists.first.name).to eq("My favstar.fm list")
868
+ expect(lists.first.name).to eq('My favstar.fm list')
869
869
  end
870
870
  end
871
- context "without a screen name passed" do
871
+ context 'without a screen name passed' do
872
872
  before do
873
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
874
- stub_get("/1.1/lists/ownerships.json").with(:query => {:screen_name => "sferik", :cursor => "-1"}).to_return(:body => fixture("ownerships.json"), :headers => {:content_type => "application/json; charset=utf-8"})
873
+ stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
874
+ stub_get('/1.1/lists/ownerships.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'}).to_return(:body => fixture('ownerships.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
875
875
  end
876
- it "requests the correct resource" do
876
+ it 'requests the correct resource' do
877
877
  @client.owned_lists
878
- expect(a_get("/1.1/lists/ownerships.json").with(:query => {:screen_name => "sferik", :cursor => "-1"})).to have_been_made
878
+ expect(a_get('/1.1/lists/ownerships.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
879
879
  end
880
- it "returns the requested list" do
880
+ it 'returns the requested list' do
881
881
  lists = @client.owned_lists
882
882
  expect(lists).to be_a Twitter::Cursor
883
883
  expect(lists.first).to be_a Twitter::List
884
- expect(lists.first.name).to eq("My favstar.fm list")
884
+ expect(lists.first.name).to eq('My favstar.fm list')
885
885
  end
886
886
  end
887
887
  end