twitter 5.1.1 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. data.tar.gz.sig +0 -0
  2. data/.yardopts +2 -0
  3. data/CHANGELOG.md +10 -1
  4. data/CONTRIBUTING.md +2 -2
  5. data/README.md +30 -20
  6. data/Rakefile +26 -5
  7. data/lib/twitter/arguments.rb +0 -1
  8. data/lib/twitter/base.rb +13 -16
  9. data/lib/twitter/basic_user.rb +3 -3
  10. data/lib/twitter/client.rb +7 -8
  11. data/lib/twitter/configuration.rb +5 -5
  12. data/lib/twitter/core_ext/enumerable.rb +0 -2
  13. data/lib/twitter/core_ext/kernel.rb +0 -2
  14. data/lib/twitter/creatable.rb +0 -1
  15. data/lib/twitter/cursor.rb +7 -10
  16. data/lib/twitter/direct_message.rb +1 -1
  17. data/lib/twitter/entity/uri.rb +2 -2
  18. data/lib/twitter/enumerable.rb +1 -2
  19. data/lib/twitter/error.rb +4 -6
  20. data/lib/twitter/error/already_favorited.rb +1 -1
  21. data/lib/twitter/error/already_posted.rb +1 -1
  22. data/lib/twitter/error/already_retweeted.rb +1 -1
  23. data/lib/twitter/error/too_many_requests.rb +2 -2
  24. data/lib/twitter/factory.rb +2 -6
  25. data/lib/twitter/geo.rb +1 -1
  26. data/lib/twitter/geo/point.rb +3 -5
  27. data/lib/twitter/geo_factory.rb +1 -5
  28. data/lib/twitter/geo_results.rb +5 -8
  29. data/lib/twitter/identity.rb +1 -2
  30. data/lib/twitter/list.rb +4 -5
  31. data/lib/twitter/media/photo.rb +1 -2
  32. data/lib/twitter/media_factory.rb +1 -5
  33. data/lib/twitter/null_object.rb +4 -6
  34. data/lib/twitter/oembed.rb +1 -1
  35. data/lib/twitter/place.rb +4 -5
  36. data/lib/twitter/profile_banner.rb +1 -3
  37. data/lib/twitter/rate_limit.rb +1 -3
  38. data/lib/twitter/relationship.rb +1 -2
  39. data/lib/twitter/rest/api/direct_messages.rb +13 -14
  40. data/lib/twitter/rest/api/favorites.rb +10 -11
  41. data/lib/twitter/rest/api/friends_and_followers.rb +36 -36
  42. data/lib/twitter/rest/api/help.rb +8 -9
  43. data/lib/twitter/rest/api/lists.rb +62 -63
  44. data/lib/twitter/rest/api/oauth.rb +3 -4
  45. data/lib/twitter/rest/api/places_and_geo.rb +9 -10
  46. data/lib/twitter/rest/api/saved_searches.rb +5 -6
  47. data/lib/twitter/rest/api/search.rb +2 -3
  48. data/lib/twitter/rest/api/spam_reporting.rb +1 -2
  49. data/lib/twitter/rest/api/suggested_users.rb +4 -5
  50. data/lib/twitter/rest/api/timelines.rb +17 -18
  51. data/lib/twitter/rest/api/trends.rb +10 -11
  52. data/lib/twitter/rest/api/tweets.rb +15 -16
  53. data/lib/twitter/rest/api/undocumented.rb +6 -7
  54. data/lib/twitter/rest/api/users.rb +51 -52
  55. data/lib/twitter/rest/api/utils.rb +23 -30
  56. data/lib/twitter/rest/client.rb +8 -9
  57. data/lib/twitter/rest/request/multipart_with_file.rb +0 -1
  58. data/lib/twitter/rest/response/parse_error_json.rb +0 -2
  59. data/lib/twitter/rest/response/parse_json.rb +0 -2
  60. data/lib/twitter/rest/response/raise_error.rb +1 -3
  61. data/lib/twitter/search_results.rb +12 -15
  62. data/lib/twitter/settings.rb +2 -2
  63. data/lib/twitter/size.rb +2 -2
  64. data/lib/twitter/source_user.rb +1 -1
  65. data/lib/twitter/streaming/client.rb +71 -18
  66. data/lib/twitter/streaming/connection.rb +1 -3
  67. data/lib/twitter/streaming/deleted_tweet.rb +8 -0
  68. data/lib/twitter/streaming/event.rb +8 -8
  69. data/lib/twitter/streaming/friend_list.rb +2 -9
  70. data/lib/twitter/streaming/message_parser.rb +13 -7
  71. data/lib/twitter/streaming/response.rb +0 -2
  72. data/lib/twitter/streaming/stall_warning.rb +7 -0
  73. data/lib/twitter/suggestion.rb +0 -1
  74. data/lib/twitter/token.rb +2 -3
  75. data/lib/twitter/trend_results.rb +5 -8
  76. data/lib/twitter/tweet.rb +16 -24
  77. data/lib/twitter/user.rb +30 -32
  78. data/lib/twitter/version.rb +2 -5
  79. data/spec/fixtures/track_streaming_user.json +2 -1
  80. data/spec/helper.rb +6 -2
  81. data/spec/twitter/base_spec.rb +9 -9
  82. data/spec/twitter/basic_user_spec.rb +6 -6
  83. data/spec/twitter/configuration_spec.rb +4 -4
  84. data/spec/twitter/cursor_spec.rb +27 -27
  85. data/spec/twitter/direct_message_spec.rb +36 -36
  86. data/spec/twitter/entity/uri_spec.rb +27 -27
  87. data/spec/twitter/error_spec.rb +21 -21
  88. data/spec/twitter/geo/point_spec.rb +9 -9
  89. data/spec/twitter/geo/polygon_spec.rb +5 -5
  90. data/spec/twitter/geo_factory_spec.rb +7 -7
  91. data/spec/twitter/geo_results_spec.rb +11 -11
  92. data/spec/twitter/geo_spec.rb +5 -5
  93. data/spec/twitter/identifiable_spec.rb +9 -9
  94. data/spec/twitter/list_spec.rb +38 -38
  95. data/spec/twitter/media/photo_spec.rb +54 -54
  96. data/spec/twitter/media_factory_spec.rb +5 -5
  97. data/spec/twitter/null_object_spec.rb +6 -6
  98. data/spec/twitter/oembed_spec.rb +65 -65
  99. data/spec/twitter/place_spec.rb +89 -60
  100. data/spec/twitter/profile_banner_spec.rb +3 -3
  101. data/spec/twitter/rate_limit_spec.rb +18 -18
  102. data/spec/twitter/relationship_spec.rb +16 -16
  103. data/spec/twitter/rest/api/direct_messages_spec.rb +61 -61
  104. data/spec/twitter/rest/api/favorites_spec.rb +93 -93
  105. data/spec/twitter/rest/api/friends_and_followers_spec.rb +349 -349
  106. data/spec/twitter/rest/api/geo_spec.rb +33 -33
  107. data/spec/twitter/rest/api/help_spec.rb +24 -24
  108. data/spec/twitter/rest/api/lists_spec.rb +487 -487
  109. data/spec/twitter/rest/api/oauth_spec.rb +30 -30
  110. data/spec/twitter/rest/api/saved_searches_spec.rb +40 -40
  111. data/spec/twitter/rest/api/search_spec.rb +16 -16
  112. data/spec/twitter/rest/api/spam_reporting_spec.rb +9 -9
  113. data/spec/twitter/rest/api/suggested_users_spec.rb +23 -23
  114. data/spec/twitter/rest/api/timelines_spec.rb +58 -58
  115. data/spec/twitter/rest/api/trends_spec.rb +26 -26
  116. data/spec/twitter/rest/api/tweets_spec.rb +284 -284
  117. data/spec/twitter/rest/api/undocumented_spec.rb +51 -51
  118. data/spec/twitter/rest/api/users_spec.rb +360 -360
  119. data/spec/twitter/rest/client_spec.rb +99 -103
  120. data/spec/twitter/saved_search_spec.rb +16 -16
  121. data/spec/twitter/search_results_spec.rb +44 -44
  122. data/spec/twitter/settings_spec.rb +8 -8
  123. data/spec/twitter/size_spec.rb +5 -5
  124. data/spec/twitter/source_user_spec.rb +6 -6
  125. data/spec/twitter/streaming/client_spec.rb +53 -49
  126. data/spec/twitter/streaming/deleted_tweet_spec.rb +23 -0
  127. data/spec/twitter/streaming/event_spec.rb +20 -22
  128. data/spec/twitter/streaming/friend_list_spec.rb +11 -0
  129. data/spec/twitter/streaming/message_parser_spec.rb +54 -0
  130. data/spec/twitter/suggestion_spec.rb +11 -11
  131. data/spec/twitter/target_user_spec.rb +6 -6
  132. data/spec/twitter/token_spec.rb +4 -4
  133. data/spec/twitter/trend_results_spec.rb +30 -30
  134. data/spec/twitter/trend_spec.rb +20 -20
  135. data/spec/twitter/tweet_spec.rb +170 -173
  136. data/spec/twitter/user_spec.rb +179 -179
  137. data/twitter.gemspec +2 -2
  138. metadata +21 -4
  139. metadata.gz.sig +2 -1
@@ -2,13 +2,13 @@ require 'helper'
2
2
 
3
3
  describe Twitter::MediaFactory do
4
4
 
5
- describe ".new" do
6
- it "generates a Photo" do
7
- media = Twitter::MediaFactory.new(:id => 1, :type => "photo")
5
+ describe '.new' do
6
+ it 'generates a Photo' do
7
+ media = Twitter::MediaFactory.new(:id => 1, :type => 'photo')
8
8
  expect(media).to be_a Twitter::Media::Photo
9
9
  end
10
- it "raises an IndexError when type is not specified" do
11
- expect{Twitter::MediaFactory.new}.to raise_error IndexError
10
+ it 'raises an IndexError when type is not specified' do
11
+ expect { Twitter::MediaFactory.new }.to raise_error IndexError
12
12
  end
13
13
  end
14
14
 
@@ -6,20 +6,20 @@ describe Twitter::NullObject do
6
6
  @null_object = Twitter::NullObject.new
7
7
  end
8
8
 
9
- describe "#nil?" do
10
- it "returns true" do
9
+ describe '#nil?' do
10
+ it 'returns true' do
11
11
  expect(@null_object.nil?).to be true
12
12
  end
13
13
  end
14
14
 
15
- describe "calling any method" do
16
- it "returns self" do
15
+ describe 'calling any method' do
16
+ it 'returns self' do
17
17
  expect(@null_object.any).to equal @null_object
18
18
  end
19
19
  end
20
20
 
21
- describe "#respond_to?" do
22
- it "returns true" do
21
+ describe '#respond_to?' do
22
+ it 'returns true' do
23
23
  expect(@null_object.respond_to?(:any)).to be true
24
24
  end
25
25
  end
@@ -2,166 +2,166 @@ require 'helper'
2
2
 
3
3
  describe Twitter::OEmbed do
4
4
 
5
- describe "#author_uri" do
6
- it "returns a URI when the author_url is set" do
7
- oembed = Twitter::OEmbed.new(:author_url => "https://twitter.com/sferik")
5
+ describe '#author_uri' do
6
+ it 'returns a URI when the author_url is set' do
7
+ oembed = Twitter::OEmbed.new(:author_url => 'https://twitter.com/sferik')
8
8
  expect(oembed.author_uri).to be_a Addressable::URI
9
- expect(oembed.author_uri.to_s).to eq("https://twitter.com/sferik")
9
+ expect(oembed.author_uri.to_s).to eq('https://twitter.com/sferik')
10
10
  end
11
- it "returns nil when the author_uri is not set" do
11
+ it 'returns nil when the author_uri is not set' do
12
12
  oembed = Twitter::OEmbed.new
13
13
  expect(oembed.author_uri).to be_nil
14
14
  end
15
15
  end
16
16
 
17
- describe "#author_uri?" do
18
- it "returns true when the author_url is set" do
19
- oembed = Twitter::OEmbed.new(:author_url => "https://twitter.com/sferik")
17
+ describe '#author_uri?' do
18
+ it 'returns true when the author_url is set' do
19
+ oembed = Twitter::OEmbed.new(:author_url => 'https://twitter.com/sferik')
20
20
  expect(oembed.author_uri?).to be true
21
21
  end
22
- it "returns false when the author_uri is not set" do
22
+ it 'returns false when the author_uri is not set' do
23
23
  oembed = Twitter::OEmbed.new
24
24
  expect(oembed.author_uri?).to be false
25
25
  end
26
26
  end
27
27
 
28
- describe "#author_name" do
29
- it "returns the author's name" do
30
- oembed = Twitter::OEmbed.new(:author_name => "Erik Michaels-Ober")
31
- expect(oembed.author_name).to eq("Erik Michaels-Ober")
28
+ describe '#author_name' do
29
+ it 'returns the author name' do
30
+ oembed = Twitter::OEmbed.new(:author_name => 'Erik Michaels-Ober')
31
+ expect(oembed.author_name).to eq('Erik Michaels-Ober')
32
32
  end
33
- it "returns nil when not set" do
33
+ it 'returns nil when not set' do
34
34
  author_name = Twitter::OEmbed.new.author_name
35
35
  expect(author_name).to be_nil
36
36
  end
37
37
  end
38
38
 
39
- describe "#cache_age" do
40
- it "returns the cache_age" do
41
- oembed = Twitter::OEmbed.new(:cache_age => "31536000000")
42
- expect(oembed.cache_age).to eq("31536000000")
39
+ describe '#cache_age' do
40
+ it 'returns the cache_age' do
41
+ oembed = Twitter::OEmbed.new(:cache_age => '31536000000')
42
+ expect(oembed.cache_age).to eq('31536000000')
43
43
  end
44
- it "returns nil when not set" do
44
+ it 'returns nil when not set' do
45
45
  cache_age = Twitter::OEmbed.new.cache_age
46
46
  expect(cache_age).to be_nil
47
47
  end
48
48
  end
49
49
 
50
- describe "#height" do
51
- it "returns the height" do
50
+ describe '#height' do
51
+ it 'returns the height' do
52
52
  oembed = Twitter::OEmbed.new(:height => 200)
53
53
  expect(oembed.height).to eq(200)
54
54
  end
55
- it "returns it as an Integer" do
55
+ it 'returns it as an Integer' do
56
56
  oembed = Twitter::OEmbed.new(:height => 200)
57
57
  expect(oembed.height).to be_an Integer
58
58
  end
59
- it "returns nil when not set" do
59
+ it 'returns nil when not set' do
60
60
  height = Twitter::OEmbed.new.height
61
61
  expect(height).to be_nil
62
62
  end
63
63
  end
64
64
 
65
- describe "#html" do
66
- it "returns the html" do
67
- oembed = Twitter::OEmbed.new(:html => "<blockquote>all my <b>witty tweet</b> stuff here</blockquote>")
68
- expect(oembed.html).to eq("<blockquote>all my <b>witty tweet</b> stuff here</blockquote>")
65
+ describe '#html' do
66
+ it 'returns the html' do
67
+ oembed = Twitter::OEmbed.new(:html => '<blockquote>all my <b>witty tweet</b> stuff here</blockquote>')
68
+ expect(oembed.html).to eq('<blockquote>all my <b>witty tweet</b> stuff here</blockquote>')
69
69
  end
70
- it "returns nil when not set" do
70
+ it 'returns nil when not set' do
71
71
  html = Twitter::OEmbed.new.html
72
72
  expect(html).to be_nil
73
73
  end
74
74
  end
75
75
 
76
- describe "#provider_name" do
77
- it "returns the provider_name" do
78
- oembed = Twitter::OEmbed.new(:provider_name => "Twitter")
79
- expect(oembed.provider_name).to eq("Twitter")
76
+ describe '#provider_name' do
77
+ it 'returns the provider_name' do
78
+ oembed = Twitter::OEmbed.new(:provider_name => 'Twitter')
79
+ expect(oembed.provider_name).to eq('Twitter')
80
80
  end
81
- it "returns nil when not set" do
81
+ it 'returns nil when not set' do
82
82
  provider_name = Twitter::OEmbed.new.provider_name
83
83
  expect(provider_name).to be_nil
84
84
  end
85
85
  end
86
86
 
87
- describe "#provider_uri" do
88
- it "returns a URI when the provider_url is set" do
89
- oembed = Twitter::OEmbed.new(:provider_url => "http://twitter.com")
87
+ describe '#provider_uri' do
88
+ it 'returns a URI when the provider_url is set' do
89
+ oembed = Twitter::OEmbed.new(:provider_url => 'http://twitter.com')
90
90
  expect(oembed.provider_uri).to be_a Addressable::URI
91
- expect(oembed.provider_uri.to_s).to eq("http://twitter.com")
91
+ expect(oembed.provider_uri.to_s).to eq('http://twitter.com')
92
92
  end
93
- it "returns nil when the provider_uri is not set" do
93
+ it 'returns nil when the provider_uri is not set' do
94
94
  oembed = Twitter::OEmbed.new
95
95
  expect(oembed.provider_uri).to be_nil
96
96
  end
97
97
  end
98
98
 
99
- describe "#provider_uri?" do
100
- it "returns true when the provider_url is set" do
101
- oembed = Twitter::OEmbed.new(:provider_url => "https://twitter.com/sferik")
99
+ describe '#provider_uri?' do
100
+ it 'returns true when the provider_url is set' do
101
+ oembed = Twitter::OEmbed.new(:provider_url => 'https://twitter.com/sferik')
102
102
  expect(oembed.provider_uri?).to be true
103
103
  end
104
- it "returns false when the provider_uri is not set" do
104
+ it 'returns false when the provider_uri is not set' do
105
105
  oembed = Twitter::OEmbed.new
106
106
  expect(oembed.provider_uri?).to be false
107
107
  end
108
108
  end
109
109
 
110
- describe "#type" do
111
- it "returns the type" do
112
- oembed = Twitter::OEmbed.new(:type => "rich")
113
- expect(oembed.type).to eq("rich")
110
+ describe '#type' do
111
+ it 'returns the type' do
112
+ oembed = Twitter::OEmbed.new(:type => 'rich')
113
+ expect(oembed.type).to eq('rich')
114
114
  end
115
- it "returns nil when not set" do
115
+ it 'returns nil when not set' do
116
116
  type = Twitter::OEmbed.new.type
117
117
  expect(type).to be_nil
118
118
  end
119
119
  end
120
120
 
121
- describe "#width" do
122
- it "returns the width" do
121
+ describe '#width' do
122
+ it 'returns the width' do
123
123
  oembed = Twitter::OEmbed.new(:width => 550)
124
124
  expect(oembed.width).to eq(550)
125
125
  end
126
- it "returns it as an Integer" do
126
+ it 'returns it as an Integer' do
127
127
  oembed = Twitter::OEmbed.new(:width => 550)
128
128
  expect(oembed.width).to be_an Integer
129
129
  end
130
- it "returns nil when not set" do
130
+ it 'returns nil when not set' do
131
131
  width = Twitter::OEmbed.new.width
132
132
  expect(width).to be_nil
133
133
  end
134
134
  end
135
135
 
136
- describe "#uri" do
137
- it "returns a URI when the url is set" do
138
- oembed = Twitter::OEmbed.new(:url => "https://twitter.com/twitterapi/status/133640144317198338")
136
+ describe '#uri' do
137
+ it 'returns a URI when the url is set' do
138
+ oembed = Twitter::OEmbed.new(:url => 'https://twitter.com/twitterapi/status/133640144317198338')
139
139
  expect(oembed.uri).to be_a Addressable::URI
140
- expect(oembed.uri.to_s).to eq("https://twitter.com/twitterapi/status/133640144317198338")
140
+ expect(oembed.uri.to_s).to eq('https://twitter.com/twitterapi/status/133640144317198338')
141
141
  end
142
- it "returns nil when the url is not set" do
142
+ it 'returns nil when the url is not set' do
143
143
  oembed = Twitter::OEmbed.new
144
144
  expect(oembed.uri).to be_nil
145
145
  end
146
146
  end
147
147
 
148
- describe "#uri?" do
149
- it "returns true when the url is set" do
150
- oembed = Twitter::OEmbed.new(:url => "https://twitter.com/twitterapi/status/133640144317198338")
148
+ describe '#uri?' do
149
+ it 'returns true when the url is set' do
150
+ oembed = Twitter::OEmbed.new(:url => 'https://twitter.com/twitterapi/status/133640144317198338')
151
151
  expect(oembed.uri?).to be true
152
152
  end
153
- it "returns false when the url is not set" do
153
+ it 'returns false when the url is not set' do
154
154
  oembed = Twitter::OEmbed.new
155
155
  expect(oembed.uri?).to be false
156
156
  end
157
157
  end
158
158
 
159
- describe "#version" do
160
- it "returns the version" do
161
- oembed = Twitter::OEmbed.new(:version => "1.0")
162
- expect(oembed.version).to eq("1.0")
159
+ describe '#version' do
160
+ it 'returns the version' do
161
+ oembed = Twitter::OEmbed.new(:version => '1.0')
162
+ expect(oembed.version).to eq('1.0')
163
163
  end
164
- it "returns nil when not set" do
164
+ it 'returns nil when not set' do
165
165
  version = Twitter::OEmbed.new.version
166
166
  expect(version).to be_nil
167
167
  end
@@ -2,128 +2,157 @@ require 'helper'
2
2
 
3
3
  describe Twitter::Place do
4
4
 
5
- describe "#==" do
6
- it "returns true when objects WOE IDs are the same" do
7
- place = Twitter::Place.new(:woeid => 1, :name => "foo")
8
- other = Twitter::Place.new(:woeid => 1, :name => "bar")
5
+ describe '#eql?' do
6
+ it 'returns true when objects WOE IDs are the same' do
7
+ place = Twitter::Place.new(:woeid => 1, :name => 'foo')
8
+ other = Twitter::Place.new(:woeid => 1, :name => 'bar')
9
+ expect(place).to eql(other)
10
+ end
11
+ it 'returns false when objects WOE IDs are different' do
12
+ place = Twitter::Place.new(:woeid => 1)
13
+ other = Twitter::Place.new(:woeid => 2)
14
+ expect(place).not_to eql(other)
15
+ end
16
+ it 'returns false when classes are different' do
17
+ place = Twitter::Place.new(:woeid => 1)
18
+ other = Twitter::Base.new(:woeid => 1)
19
+ expect(place).not_to eql(other)
20
+ end
21
+ end
22
+
23
+ describe '#bounding_box' do
24
+ it 'returns a Twitter::Geo when bounding_box is set' do
25
+ place = Twitter::Place.new(:woeid => '247f43d441defc03', :bounding_box => {:type => 'Polygon', :coordinates => [[[-122.40348192, 37.77752898], [-122.387436, 37.77752898], [-122.387436, 37.79448597], [-122.40348192, 37.79448597]]]})
26
+ expect(place.bounding_box).to be_a Twitter::Geo::Polygon
27
+ end
28
+ it 'returns nil when not bounding_box is not set' do
29
+ place = Twitter::Place.new(:woeid => '247f43d441defc03')
30
+ expect(place.bounding_box).to be_nil
31
+ end
32
+ end
33
+
34
+ describe '#==' do
35
+ it 'returns true when objects WOE IDs are the same' do
36
+ place = Twitter::Place.new(:woeid => 1, :name => 'foo')
37
+ other = Twitter::Place.new(:woeid => 1, :name => 'bar')
9
38
  expect(place == other).to be true
10
39
  end
11
- it "returns false when objects WOE IDs are different" do
40
+ it 'returns false when objects WOE IDs are different' do
12
41
  place = Twitter::Place.new(:woeid => 1)
13
42
  other = Twitter::Place.new(:woeid => 2)
14
43
  expect(place == other).to be false
15
44
  end
16
- it "returns false when classes are different" do
45
+ it 'returns false when classes are different' do
17
46
  place = Twitter::Place.new(:woeid => 1)
18
47
  other = Twitter::Base.new(:woeid => 1)
19
48
  expect(place == other).to be false
20
49
  end
21
50
  end
22
51
 
23
- describe "#bounding_box" do
24
- it "returns a Twitter::Geo when bounding_box is set" do
25
- place = Twitter::Place.new(:woeid => "247f43d441defc03", :bounding_box => {:type => "Polygon", :coordinates => [[[-122.40348192, 37.77752898], [-122.387436, 37.77752898], [-122.387436, 37.79448597], [-122.40348192, 37.79448597]]]})
52
+ describe '#bounding_box' do
53
+ it 'returns a Twitter::Geo when bounding_box is set' do
54
+ place = Twitter::Place.new(:woeid => '247f43d441defc03', :bounding_box => {:type => 'Polygon', :coordinates => [[[-122.40348192, 37.77752898], [-122.387436, 37.77752898], [-122.387436, 37.79448597], [-122.40348192, 37.79448597]]]})
26
55
  expect(place.bounding_box).to be_a Twitter::Geo::Polygon
27
56
  end
28
- it "returns nil when not bounding_box is not set" do
29
- place = Twitter::Place.new(:woeid => "247f43d441defc03")
57
+ it 'returns nil when not bounding_box is not set' do
58
+ place = Twitter::Place.new(:woeid => '247f43d441defc03')
30
59
  expect(place.bounding_box).to be_nil
31
60
  end
32
61
  end
33
62
 
34
- describe "#bounding_box?" do
35
- it "returns true when bounding_box is set" do
36
- place = Twitter::Place.new(:woeid => "247f43d441defc03", :bounding_box => {:type => "Polygon", :coordinates => [[[-122.40348192, 37.77752898], [-122.387436, 37.77752898], [-122.387436, 37.79448597], [-122.40348192, 37.79448597]]]})
63
+ describe '#bounding_box?' do
64
+ it 'returns true when bounding_box is set' do
65
+ place = Twitter::Place.new(:woeid => '247f43d441defc03', :bounding_box => {:type => 'Polygon', :coordinates => [[[-122.40348192, 37.77752898], [-122.387436, 37.77752898], [-122.387436, 37.79448597], [-122.40348192, 37.79448597]]]})
37
66
  expect(place.bounding_box?).to be true
38
67
  end
39
- it "returns false when bounding_box is not set" do
40
- place = Twitter::Place.new(:woeid => "247f43d441defc03")
68
+ it 'returns false when bounding_box is not set' do
69
+ place = Twitter::Place.new(:woeid => '247f43d441defc03')
41
70
  expect(place.bounding_box?).to be false
42
71
  end
43
72
  end
44
73
 
45
- describe "#contained_within" do
46
- it "returns a Twitter::Place when contained_within is set" do
47
- place = Twitter::Place.new(:woeid => "247f43d441defc03", :contained_within => {:woeid => "247f43d441defc04"})
74
+ describe '#contained_within' do
75
+ it 'returns a Twitter::Place when contained_within is set' do
76
+ place = Twitter::Place.new(:woeid => '247f43d441defc03', :contained_within => {:woeid => '247f43d441defc04'})
48
77
  expect(place.contained_within).to be_a Twitter::Place
49
78
  end
50
- it "returns nil when not contained_within is not set" do
51
- place = Twitter::Place.new(:woeid => "247f43d441defc03")
79
+ it 'returns nil when not contained_within is not set' do
80
+ place = Twitter::Place.new(:woeid => '247f43d441defc03')
52
81
  expect(place.contained_within).to be_nil
53
82
  end
54
83
  end
55
84
 
56
- describe "#contained_within?" do
57
- it "returns true when contained_within is set" do
58
- place = Twitter::Place.new(:woeid => "247f43d441defc03", :contained_within => {:woeid => "247f43d441defc04"})
85
+ describe '#contained_within?' do
86
+ it 'returns true when contained_within is set' do
87
+ place = Twitter::Place.new(:woeid => '247f43d441defc03', :contained_within => {:woeid => '247f43d441defc04'})
59
88
  expect(place.contained?).to be true
60
89
  end
61
- it "returns false when contained_within is not set" do
62
- place = Twitter::Place.new(:woeid => "247f43d441defc03")
90
+ it 'returns false when contained_within is not set' do
91
+ place = Twitter::Place.new(:woeid => '247f43d441defc03')
63
92
  expect(place.contained?).to be false
64
93
  end
65
94
  end
66
95
 
67
- describe "#country_code" do
68
- it "returns a country code when set with country_code" do
69
- place = Twitter::Place.new(:woeid => "247f43d441defc03", :country_code => "US")
70
- expect(place.country_code).to eq("US")
96
+ describe '#country_code' do
97
+ it 'returns a country code when set with country_code' do
98
+ place = Twitter::Place.new(:woeid => '247f43d441defc03', :country_code => 'US')
99
+ expect(place.country_code).to eq('US')
71
100
  end
72
- it "returns a country code when set with countryCode" do
73
- place = Twitter::Place.new(:woeid => "247f43d441defc03", :countryCode => "US")
74
- expect(place.country_code).to eq("US")
101
+ it 'returns a country code when set with countryCode' do
102
+ place = Twitter::Place.new(:woeid => '247f43d441defc03', :countryCode => 'US') # rubocop:disable SymbolName
103
+ expect(place.country_code).to eq('US')
75
104
  end
76
- it "returns nil when not set" do
77
- place = Twitter::Place.new(:woeid => "247f43d441defc03")
105
+ it 'returns nil when not set' do
106
+ place = Twitter::Place.new(:woeid => '247f43d441defc03')
78
107
  expect(place.country_code).to be_nil
79
108
  end
80
109
  end
81
110
 
82
- describe "#parent_id" do
83
- it "returns a parent ID when set with parentid" do
84
- place = Twitter::Place.new(:woeid => "247f43d441defc03", :parentid => 1)
111
+ describe '#parent_id' do
112
+ it 'returns a parent ID when set with parentid' do
113
+ place = Twitter::Place.new(:woeid => '247f43d441defc03', :parentid => 1)
85
114
  expect(place.parent_id).to eq(1)
86
115
  end
87
- it "returns nil when not set" do
88
- place = Twitter::Place.new(:woeid => "247f43d441defc03")
116
+ it 'returns nil when not set' do
117
+ place = Twitter::Place.new(:woeid => '247f43d441defc03')
89
118
  expect(place.parent_id).to be_nil
90
119
  end
91
120
  end
92
121
 
93
- describe "#place_type" do
94
- it "returns a place type when set with place_type" do
95
- place = Twitter::Place.new(:woeid => "247f43d441defc03", :place_type => "city")
96
- expect(place.place_type).to eq("city")
122
+ describe '#place_type' do
123
+ it 'returns a place type when set with place_type' do
124
+ place = Twitter::Place.new(:woeid => '247f43d441defc03', :place_type => 'city')
125
+ expect(place.place_type).to eq('city')
97
126
  end
98
- it "returns a place type when set with placeType[name]" do
99
- place = Twitter::Place.new(:woeid => "247f43d441defc03", :placeType => {:name => "Town"})
100
- expect(place.place_type).to eq("Town")
127
+ it 'returns a place type when set with placeType[name]' do
128
+ place = Twitter::Place.new(:woeid => '247f43d441defc03', :placeType => {:name => 'Town'}) # rubocop:disable SymbolName
129
+ expect(place.place_type).to eq('Town')
101
130
  end
102
- it "returns nil when not set" do
103
- place = Twitter::Place.new(:woeid => "247f43d441defc03")
131
+ it 'returns nil when not set' do
132
+ place = Twitter::Place.new(:woeid => '247f43d441defc03')
104
133
  expect(place.place_type).to be_nil
105
134
  end
106
135
  end
107
136
 
108
- describe "#uri" do
109
- it "returns a URI when the url is set" do
110
- place = Twitter::Place.new(:woeid => "247f43d441defc03", :url => "https://api.twitter.com/1.1/geo/id/247f43d441defc03.json")
137
+ describe '#uri' do
138
+ it 'returns a URI when the url is set' do
139
+ place = Twitter::Place.new(:woeid => '247f43d441defc03', :url => 'https://api.twitter.com/1.1/geo/id/247f43d441defc03.json')
111
140
  expect(place.uri).to be_a Addressable::URI
112
- expect(place.uri.to_s).to eq("https://api.twitter.com/1.1/geo/id/247f43d441defc03.json")
141
+ expect(place.uri.to_s).to eq('https://api.twitter.com/1.1/geo/id/247f43d441defc03.json')
113
142
  end
114
- it "returns nil when the url is not set" do
115
- place = Twitter::Place.new(:woeid => "247f43d441defc03")
143
+ it 'returns nil when the url is not set' do
144
+ place = Twitter::Place.new(:woeid => '247f43d441defc03')
116
145
  expect(place.uri).to be_nil
117
146
  end
118
147
  end
119
148
 
120
- describe "#uri?" do
121
- it "returns true when the url is set" do
122
- place = Twitter::Place.new(:woeid => "247f43d441defc03", :url => "https://api.twitter.com/1.1/geo/id/247f43d441defc03.json")
149
+ describe '#uri?' do
150
+ it 'returns true when the url is set' do
151
+ place = Twitter::Place.new(:woeid => '247f43d441defc03', :url => 'https://api.twitter.com/1.1/geo/id/247f43d441defc03.json')
123
152
  expect(place.uri?).to be true
124
153
  end
125
- it "returns false when the url is not set" do
126
- place = Twitter::Place.new(:woeid => "247f43d441defc03")
154
+ it 'returns false when the url is not set' do
155
+ place = Twitter::Place.new(:woeid => '247f43d441defc03')
127
156
  expect(place.uri?).to be false
128
157
  end
129
158
  end