twitter 4.1.0 → 4.1.1
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.
- data/CHANGELOG.md +5 -0
- data/README.md +11 -9
- data/lib/twitter/api.rb +3 -5
- data/lib/twitter/base.rb +1 -4
- data/lib/twitter/geo/point.rb +2 -2
- data/lib/twitter/request/multipart_with_file.rb +1 -1
- data/lib/twitter/tweet.rb +9 -1
- data/lib/twitter/user.rb +2 -0
- data/lib/twitter/version.rb +1 -1
- data/spec/fixtures/status.json +1 -1
- data/spec/helper.rb +6 -0
- data/spec/twitter/action/favorite_spec.rb +6 -6
- data/spec/twitter/action/follow_spec.rb +6 -6
- data/spec/twitter/action/list_member_added_spec.rb +9 -9
- data/spec/twitter/action/mention_spec.rb +11 -11
- data/spec/twitter/action/reply_spec.rb +9 -9
- data/spec/twitter/action/retweet_spec.rb +9 -9
- data/spec/twitter/action_factory_spec.rb +7 -9
- data/spec/twitter/action_spec.rb +2 -2
- data/spec/twitter/api/account_spec.rb +38 -66
- data/spec/twitter/api/activity_spec.rb +6 -10
- data/spec/twitter/api/blocks_spec.rb +38 -83
- data/spec/twitter/api/direct_messages_spec.rb +33 -55
- data/spec/twitter/api/friendships_spec.rb +124 -266
- data/spec/twitter/api/geo_spec.rb +18 -36
- data/spec/twitter/api/help_spec.rb +15 -23
- data/spec/twitter/api/lists_spec.rb +172 -402
- data/spec/twitter/api/report_spam_spec.rb +5 -9
- data/spec/twitter/api/saved_searches_spec.rb +23 -35
- data/spec/twitter/api/search_spec.rb +15 -25
- data/spec/twitter/api/statuses_spec.rb +137 -235
- data/spec/twitter/api/trends_spec.rb +17 -29
- data/spec/twitter/api/users_spec.rb +90 -181
- data/spec/twitter/base_spec.rb +38 -40
- data/spec/twitter/basic_user_spec.rb +3 -3
- data/spec/twitter/client_spec.rb +28 -46
- data/spec/twitter/configuration_spec.rb +3 -3
- data/spec/twitter/cursor_spec.rb +16 -32
- data/spec/twitter/direct_message_spec.rb +9 -9
- data/spec/twitter/error/client_error_spec.rb +4 -12
- data/spec/twitter/error/server_error_spec.rb +2 -6
- data/spec/twitter/error_spec.rb +2 -2
- data/spec/twitter/geo/point_spec.rb +6 -6
- data/spec/twitter/geo/polygon_spec.rb +4 -4
- data/spec/twitter/geo_factory_spec.rb +3 -5
- data/spec/twitter/geo_spec.rb +4 -4
- data/spec/twitter/identifiable_spec.rb +9 -13
- data/spec/twitter/list_spec.rb +7 -7
- data/spec/twitter/media/photo_spec.rb +6 -6
- data/spec/twitter/media_factory_spec.rb +2 -4
- data/spec/twitter/oembed_spec.rb +24 -24
- data/spec/twitter/place_spec.rb +13 -13
- data/spec/twitter/rate_limit_spec.rb +16 -16
- data/spec/twitter/relationship_spec.rb +5 -5
- data/spec/twitter/saved_search_spec.rb +5 -5
- data/spec/twitter/search_results_spec.rb +21 -21
- data/spec/twitter/settings_spec.rb +2 -2
- data/spec/twitter/size_spec.rb +6 -6
- data/spec/twitter/source_user_spec.rb +3 -3
- data/spec/twitter/suggestion_spec.rb +9 -9
- data/spec/twitter/target_user_spec.rb +3 -3
- data/spec/twitter/trend_spec.rb +6 -6
- data/spec/twitter/tweet_spec.rb +69 -69
- data/spec/twitter/user_spec.rb +43 -43
- data/spec/twitter_spec.rb +12 -16
- metadata +2 -2
data/spec/twitter_spec.rb
CHANGED
@@ -9,41 +9,37 @@ describe Twitter do
|
|
9
9
|
context "when delegating to a client" do
|
10
10
|
|
11
11
|
before do
|
12
|
-
stub_get("/1.1/statuses/user_timeline.json").
|
13
|
-
with(:query => {:screen_name => "sferik"}).
|
14
|
-
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
12
|
+
stub_get("/1.1/statuses/user_timeline.json").with(:query => {:screen_name => "sferik"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
15
13
|
end
|
16
14
|
|
17
15
|
it "requests the correct resource" do
|
18
16
|
Twitter.user_timeline('sferik')
|
19
|
-
a_get("/1.1/statuses/user_timeline.json").
|
20
|
-
with(:query => {:screen_name => "sferik"}).
|
21
|
-
should have_been_made
|
17
|
+
expect(a_get("/1.1/statuses/user_timeline.json").with(:query => {:screen_name => "sferik"})).to have_been_made
|
22
18
|
end
|
23
19
|
|
24
20
|
it "returns the same results as a client" do
|
25
|
-
Twitter.user_timeline('sferik').
|
21
|
+
expect(Twitter.user_timeline('sferik')).to eq Twitter::Client.new.user_timeline('sferik')
|
26
22
|
end
|
27
23
|
|
28
24
|
end
|
29
25
|
|
30
|
-
describe
|
26
|
+
describe ".respond_to?" do
|
31
27
|
it "delegates to Twitter::Client" do
|
32
|
-
Twitter.respond_to?(:user).
|
28
|
+
expect(Twitter.respond_to?(:user)).to be_true
|
33
29
|
end
|
34
30
|
it "takes an optional argument" do
|
35
|
-
Twitter.respond_to?(:client, true).
|
31
|
+
expect(Twitter.respond_to?(:client, true)).to be_true
|
36
32
|
end
|
37
33
|
end
|
38
34
|
|
39
35
|
describe ".client" do
|
40
36
|
it "returns a Twitter::Client" do
|
41
|
-
Twitter.client.
|
37
|
+
expect(Twitter.client).to be_a Twitter::Client
|
42
38
|
end
|
43
39
|
|
44
40
|
context "when the options don't change" do
|
45
41
|
it "caches the client" do
|
46
|
-
Twitter.client.
|
42
|
+
expect(Twitter.client).to eq Twitter.client
|
47
43
|
end
|
48
44
|
end
|
49
45
|
context "when the options change" do
|
@@ -54,7 +50,7 @@ describe Twitter do
|
|
54
50
|
config.consumer_secret = '123'
|
55
51
|
end
|
56
52
|
client2 = Twitter.client
|
57
|
-
client1.
|
53
|
+
expect(client1).not_to eq client2
|
58
54
|
end
|
59
55
|
end
|
60
56
|
end
|
@@ -65,7 +61,7 @@ describe Twitter do
|
|
65
61
|
Twitter.configure do |config|
|
66
62
|
config.send("#{key}=", key)
|
67
63
|
end
|
68
|
-
Twitter.instance_variable_get(:"@#{key}").
|
64
|
+
expect(Twitter.instance_variable_get(:"@#{key}")).to eq key
|
69
65
|
end
|
70
66
|
end
|
71
67
|
end
|
@@ -78,7 +74,7 @@ describe Twitter do
|
|
78
74
|
config.oauth_token = 'OT'
|
79
75
|
config.oauth_token_secret = 'OS'
|
80
76
|
end
|
81
|
-
Twitter.credentials
|
77
|
+
expect(Twitter.credentials?).to be_true
|
82
78
|
end
|
83
79
|
it "returns false if any credentials are missing" do
|
84
80
|
Twitter.configure do |config|
|
@@ -86,7 +82,7 @@ describe Twitter do
|
|
86
82
|
config.consumer_secret = 'CS'
|
87
83
|
config.oauth_token = 'OT'
|
88
84
|
end
|
89
|
-
Twitter.credentials
|
85
|
+
expect(Twitter.credentials?).to be_false
|
90
86
|
end
|
91
87
|
end
|
92
88
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2012-10-
|
15
|
+
date: 2012-10-18 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: faraday
|