t 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -0
- data/lib/t/cli.rb +113 -181
- data/lib/t/core_ext/string.rb +5 -1
- data/lib/t/delete.rb +13 -13
- data/lib/t/list.rb +35 -28
- data/lib/t/printable.rb +82 -0
- data/lib/t/requestable.rb +5 -3
- data/lib/t/search.rb +6 -24
- data/lib/t/set.rb +2 -2
- data/lib/t/version.rb +2 -2
- data/spec/cli_spec.rb +1129 -282
- data/spec/delete_spec.rb +71 -90
- data/spec/fixtures/direct_messages.json +1 -1
- data/spec/fixtures/search.json +1 -1
- data/spec/fixtures/status.json +1 -1
- data/spec/fixtures/statuses.json +1 -1
- data/spec/fixtures/users_list.json +1 -1
- data/spec/helper.rb +3 -1
- data/spec/list_spec.rb +250 -37
- data/spec/search_spec.rb +310 -255
- data/t.gemspec +1 -1
- metadata +12 -3
data/spec/search_spec.rb
CHANGED
@@ -6,12 +6,12 @@ describe T::Search do
|
|
6
6
|
before do
|
7
7
|
rcfile = RCFile.instance
|
8
8
|
rcfile.path = fixture_path + "/.trc"
|
9
|
-
@
|
9
|
+
@search = T::Search.new
|
10
10
|
@old_stderr = $stderr
|
11
11
|
$stderr = StringIO.new
|
12
12
|
@old_stdout = $stdout
|
13
13
|
$stdout = StringIO.new
|
14
|
-
Timecop.freeze(Time.
|
14
|
+
Timecop.freeze(Time.utc(2011, 11, 24, 16, 20, 0))
|
15
15
|
end
|
16
16
|
|
17
17
|
after do
|
@@ -27,41 +27,83 @@ describe T::Search do
|
|
27
27
|
to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
28
28
|
end
|
29
29
|
it "should request the correct resource" do
|
30
|
-
@
|
30
|
+
@search.all("twitter")
|
31
31
|
a_request(:get, "https://search.twitter.com/search.json").
|
32
32
|
with(:query => {:q => "twitter", :include_entities => "false", :rpp => "20"}).
|
33
33
|
should have_been_made
|
34
34
|
end
|
35
35
|
it "should have the correct output" do
|
36
|
-
@
|
37
|
-
$stdout.string.should == <<-eos
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
36
|
+
@search.all("twitter")
|
37
|
+
$stdout.string.should == <<-eos
|
38
|
+
JessRoveel: Pondre lo mas importante de Hamlet en Twitter para recordarlo mejor :D (7 months ago)
|
39
|
+
lauravgeest: Twitter doet het al 7 uur niet meer (7 months ago)
|
40
|
+
Jenny_Bearx333: I keep thinking that twitter is @instagram , and therefore double tap all the pics I like... #NotWorking (7 months ago)
|
41
|
+
misspoxtonX: RT @jordantaylorhi: twitter friends > twats at school (7 months ago)
|
42
|
+
PatrickBrickman: RT @zeus30hightower: Too all Bama fans and followers my cousin mark Barron doesn't have a twitter so please disregard any tweets from that user (7 months ago)
|
43
|
+
KolonelX: Ik refresh twitter op me telefoon terwijl ik tweetdeck voor me open heb staan (7 months ago)
|
44
|
+
VLGPRLG5: @mikeyway and you too RT @NimcyGD: @gerardway Get your ass back to twitter, okay? :3 (7 months ago)
|
45
|
+
xRhiBabyx: Trying to persuade the boyf to get on twitter and failing. Help? @holly_haime @Ckwarburton @samwarburton_ @chrishaime @rowloboy (7 months ago)
|
46
|
+
juliotrv: RT @lookinglassbr: Lançamentos outono-inverno 2012...CONFIRA em http://t.co/YAk8OXp7 http://t.co/fmmrVrbG (7 months ago)
|
47
|
+
shanleyaustin27: RT @caaammmmi: @shanleyaustin27 .....and this hahahahaa http://t.co/wzCMx6ZU (7 months ago)
|
48
|
+
Dame_Valuta: RT @Paiser10: Great @chelseafc training at Nou Camp! #cfc http://t.co/k00TnRyR (7 months ago)
|
49
|
+
miss_indyiah: smh, @IndianaHustle done turned into a twitter addict..fuck goin on lol ? (7 months ago)
|
50
|
+
CAROLINEWOLLER: RT @Mark_Ingram28: To all Bama fans and followers, please unfollow and pay no attention to any user posing to be Mark Barron. My bro doesn't have a twitter! (7 months ago)
|
51
|
+
shelbytrenchdww: RT @The90sLife: Admit it, we all have a cabinet that looks like this. http://t.co/gQEkQw5G (7 months ago)
|
52
|
+
kabos84: RT @JF_q8: بالله عليكم ،، مو عيب !!! .. http://t.co/e29GV7Ow (7 months ago)
|
53
53
|
eos
|
54
54
|
end
|
55
|
+
context "--long" do
|
56
|
+
before do
|
57
|
+
@search.options = @search.options.merge(:long => true)
|
58
|
+
end
|
59
|
+
it "should list in long format" do
|
60
|
+
@search.all("twitter")
|
61
|
+
$stdout.string.should == <<-eos
|
62
|
+
ID Posted at Screen name Text
|
63
|
+
194521262415032320 Apr 23 2011 JessRoveel Pondre lo mas importante de Hamlet en Twitter para recordarlo mejor :D
|
64
|
+
194521262326951936 Apr 23 2011 lauravgeest Twitter doet het al 7 uur niet meer
|
65
|
+
194521262234669056 Apr 23 2011 Jenny_Bearx333 I keep thinking that twitter is @instagram , and therefore double tap all the pics I like... #NotWorking
|
66
|
+
194521262138204160 Apr 23 2011 misspoxtonX RT @jordantaylorhi: twitter friends > twats at school
|
67
|
+
194521262134001665 Apr 23 2011 PatrickBrickman RT @zeus30hightower: Too all Bama fans and followers my cousin mark Barron doesn't have a twitter so please disregard any tweets from that user
|
68
|
+
194521262129811456 Apr 23 2011 KolonelX Ik refresh twitter op me telefoon terwijl ik tweetdeck voor me open heb staan
|
69
|
+
194521261852995586 Apr 23 2011 VLGPRLG5 @mikeyway and you too RT @NimcyGD: @gerardway Get your ass back to twitter, okay? :3
|
70
|
+
194521261756530689 Apr 23 2011 xRhiBabyx Trying to persuade the boyf to get on twitter and failing. Help? @holly_haime @Ckwarburton @samwarburton_ @chrishaime @rowloboy
|
71
|
+
194521261630697473 Apr 23 2011 juliotrv RT @lookinglassbr: Lançamentos outono-inverno 2012...CONFIRA em http://t.co/YAk8OXp7 http://t.co/fmmrVrbG
|
72
|
+
194521261571964928 Apr 23 2011 shanleyaustin27 RT @caaammmmi: @shanleyaustin27 .....and this hahahahaa http://t.co/wzCMx6ZU
|
73
|
+
194521261563580416 Apr 23 2011 Dame_Valuta RT @Paiser10: Great @chelseafc training at Nou Camp! #cfc http://t.co/k00TnRyR
|
74
|
+
194521261488095232 Apr 23 2011 miss_indyiah smh, @IndianaHustle done turned into a twitter addict..fuck goin on lol ?
|
75
|
+
194521261370650625 Apr 23 2011 CAROLINEWOLLER RT @Mark_Ingram28: To all Bama fans and followers, please unfollow and pay no attention to any user posing to be Mark Barron. My bro doesn't have a twitter!
|
76
|
+
194521261370642432 Apr 23 2011 shelbytrenchdww RT @The90sLife: Admit it, we all have a cabinet that looks like this. http://t.co/gQEkQw5G
|
77
|
+
194521261307727872 Apr 23 2011 kabos84 RT @JF_q8: بالله عليكم ،، مو عيب !!! .. http://t.co/e29GV7Ow
|
78
|
+
eos
|
79
|
+
end
|
80
|
+
end
|
81
|
+
context "--number" do
|
82
|
+
before do
|
83
|
+
@search.options = @search.options.merge(:number => 1)
|
84
|
+
stub_request(:get, "https://search.twitter.com/search.json").
|
85
|
+
with(:query => {:q => "twitter", :include_entities => "false", :rpp => "1"}).
|
86
|
+
to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
87
|
+
end
|
88
|
+
it "should limit the number of results" do
|
89
|
+
@search.all("twitter")
|
90
|
+
a_request(:get, "https://search.twitter.com/search.json").
|
91
|
+
with(:query => {:q => "twitter", :include_entities => "false", :rpp => "1"}).
|
92
|
+
should have_been_made
|
93
|
+
end
|
94
|
+
end
|
55
95
|
end
|
56
96
|
|
57
97
|
describe "#favorites" do
|
58
|
-
|
98
|
+
before do
|
59
99
|
1.upto(16).each do |page|
|
60
100
|
stub_get("/1/favorites.json").
|
61
101
|
with(:query => {:count => "200", :page => "#{page}"}).
|
62
102
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
63
103
|
end
|
64
|
-
|
104
|
+
end
|
105
|
+
it "should request the correct resource" do
|
106
|
+
@search.favorites("twitter")
|
65
107
|
1.upto(16).each do |page|
|
66
108
|
a_get("/1/favorites.json").
|
67
109
|
with(:query => {:count => "200", :page => "#{page}"}).
|
@@ -69,59 +111,60 @@ describe T::Search do
|
|
69
111
|
end
|
70
112
|
end
|
71
113
|
it "should have the correct output" do
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
91
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
92
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
93
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
94
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
95
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
96
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
97
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
98
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
99
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
100
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
101
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
102
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
103
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
104
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
105
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
106
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
107
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
108
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
109
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
110
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
114
|
+
@search.favorites("twitter")
|
115
|
+
$stdout.string.should == <<-eos
|
116
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
117
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
118
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
119
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
120
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
121
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
122
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
123
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
124
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
125
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
126
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
127
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
128
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
129
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
130
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
131
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
111
132
|
eos
|
112
133
|
end
|
134
|
+
context "--long" do
|
135
|
+
before do
|
136
|
+
@search.options = @search.options.merge(:long => true)
|
137
|
+
end
|
138
|
+
it "should list in long format" do
|
139
|
+
@search.favorites("twitter")
|
140
|
+
$stdout.string.should == <<-eos
|
141
|
+
ID Posted at Screen name Text
|
142
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
143
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
144
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
145
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
146
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
147
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
148
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
149
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
150
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
151
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
152
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
153
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
154
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
155
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
156
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
157
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
158
|
+
eos
|
159
|
+
end
|
160
|
+
end
|
113
161
|
context "Twitter is down" do
|
114
162
|
it "should retry 3 times and then raise an error" do
|
115
|
-
1.upto(15).each do |page|
|
116
|
-
stub_get("/1/favorites.json").
|
117
|
-
with(:query => {:count => "200", :page => "#{page}"}).
|
118
|
-
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
119
|
-
end
|
120
163
|
stub_get("/1/favorites.json").
|
121
164
|
with(:query => {:count => "200", :page => "16"}).
|
122
165
|
to_return(:status => 502)
|
123
166
|
lambda do
|
124
|
-
@
|
167
|
+
@search.favorites("twitter")
|
125
168
|
end.should raise_error("Twitter is down or being upgraded.")
|
126
169
|
a_get("/1/favorites.json").
|
127
170
|
with(:query => {:count => "200", :page => "16"}).
|
@@ -131,13 +174,15 @@ describe T::Search do
|
|
131
174
|
end
|
132
175
|
|
133
176
|
describe "#mentions" do
|
134
|
-
|
177
|
+
before do
|
135
178
|
1.upto(16).each do |page|
|
136
179
|
stub_get("/1/statuses/mentions.json").
|
137
180
|
with(:query => {:count => "200", :page => "#{page}"}).
|
138
181
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
139
182
|
end
|
140
|
-
|
183
|
+
end
|
184
|
+
it "should request the correct resource" do
|
185
|
+
@search.mentions("twitter")
|
141
186
|
1.upto(16).each do |page|
|
142
187
|
a_get("/1/statuses/mentions.json").
|
143
188
|
with(:query => {:count => "200", :page => "#{page}"}).
|
@@ -145,59 +190,60 @@ describe T::Search do
|
|
145
190
|
end
|
146
191
|
end
|
147
192
|
it "should have the correct output" do
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
167
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
168
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
169
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
170
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
171
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
172
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
173
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
174
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
175
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
176
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
177
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
178
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
179
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
180
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
181
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
182
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
183
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
184
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
185
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
186
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
193
|
+
@search.mentions("twitter")
|
194
|
+
$stdout.string.should == <<-eos
|
195
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
196
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
197
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
198
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
199
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
200
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
201
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
202
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
203
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
204
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
205
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
206
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
207
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
208
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
209
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
210
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
187
211
|
eos
|
188
212
|
end
|
213
|
+
context "--long" do
|
214
|
+
before do
|
215
|
+
@search.options = @search.options.merge(:long => true)
|
216
|
+
end
|
217
|
+
it "should list in long format" do
|
218
|
+
@search.mentions("twitter")
|
219
|
+
$stdout.string.should == <<-eos
|
220
|
+
ID Posted at Screen name Text
|
221
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
222
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
223
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
224
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
225
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
226
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
227
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
228
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
229
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
230
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
231
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
232
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
233
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
234
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
235
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
236
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
237
|
+
eos
|
238
|
+
end
|
239
|
+
end
|
189
240
|
context "Twitter is down" do
|
190
241
|
it "should retry 3 times and then raise an error" do
|
191
|
-
1.upto(15).each do |page|
|
192
|
-
stub_get("/1/statuses/mentions.json").
|
193
|
-
with(:query => {:count => "200", :page => "#{page}"}).
|
194
|
-
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
195
|
-
end
|
196
242
|
stub_get("/1/statuses/mentions.json").
|
197
243
|
with(:query => {:count => "200", :page => "16"}).
|
198
244
|
to_return(:status => 502)
|
199
245
|
lambda do
|
200
|
-
@
|
246
|
+
@search.mentions("twitter")
|
201
247
|
end.should raise_error("Twitter is down or being upgraded.")
|
202
248
|
a_get("/1/statuses/mentions.json").
|
203
249
|
with(:query => {:count => "200", :page => "16"}).
|
@@ -207,13 +253,15 @@ describe T::Search do
|
|
207
253
|
end
|
208
254
|
|
209
255
|
describe "#retweets" do
|
210
|
-
|
256
|
+
before do
|
211
257
|
1.upto(16).each do |page|
|
212
258
|
stub_get("/1/statuses/retweeted_by_me.json").
|
213
259
|
with(:query => {:count => "200", :page => "#{page}"}).
|
214
260
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
215
261
|
end
|
216
|
-
|
262
|
+
end
|
263
|
+
it "should request the correct resource" do
|
264
|
+
@search.retweets("twitter")
|
217
265
|
1.upto(16).each do |page|
|
218
266
|
a_get("/1/statuses/retweeted_by_me.json").
|
219
267
|
with(:query => {:count => "200", :page => "#{page}"}).
|
@@ -221,59 +269,60 @@ describe T::Search do
|
|
221
269
|
end
|
222
270
|
end
|
223
271
|
it "should have the correct output" do
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
243
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
244
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
245
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
246
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
247
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
248
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
249
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
250
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
251
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
252
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
253
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
254
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
255
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
256
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
257
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
258
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
259
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
260
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
261
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
262
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
272
|
+
@search.retweets("twitter")
|
273
|
+
$stdout.string.should == <<-eos
|
274
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
275
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
276
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
277
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
278
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
279
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
280
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
281
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
282
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
283
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
284
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
285
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
286
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
287
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
288
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
289
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
263
290
|
eos
|
264
291
|
end
|
292
|
+
context "--long" do
|
293
|
+
before do
|
294
|
+
@search.options = @search.options.merge(:long => true)
|
295
|
+
end
|
296
|
+
it "should list in long format" do
|
297
|
+
@search.retweets("twitter")
|
298
|
+
$stdout.string.should == <<-eos
|
299
|
+
ID Posted at Screen name Text
|
300
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
301
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
302
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
303
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
304
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
305
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
306
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
307
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
308
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
309
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
310
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
311
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
312
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
313
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
314
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
315
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
316
|
+
eos
|
317
|
+
end
|
318
|
+
end
|
265
319
|
context "Twitter is down" do
|
266
320
|
it "should retry 3 times and then raise an error" do
|
267
|
-
1.upto(15).each do |page|
|
268
|
-
stub_get("/1/statuses/retweeted_by_me.json").
|
269
|
-
with(:query => {:count => "200", :page => "#{page}"}).
|
270
|
-
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
271
|
-
end
|
272
321
|
stub_get("/1/statuses/retweeted_by_me.json").
|
273
322
|
with(:query => {:count => "200", :page => "16"}).
|
274
323
|
to_return(:status => 502)
|
275
324
|
lambda do
|
276
|
-
@
|
325
|
+
@search.retweets("twitter")
|
277
326
|
end.should raise_error("Twitter is down or being upgraded.")
|
278
327
|
a_get("/1/statuses/retweeted_by_me.json").
|
279
328
|
with(:query => {:count => "200", :page => "16"}).
|
@@ -283,13 +332,15 @@ describe T::Search do
|
|
283
332
|
end
|
284
333
|
|
285
334
|
describe "#timeline" do
|
286
|
-
|
335
|
+
before do
|
287
336
|
1.upto(16).each do |page|
|
288
337
|
stub_get("/1/statuses/home_timeline.json").
|
289
338
|
with(:query => {:count => "200", :page => "#{page}"}).
|
290
339
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
291
340
|
end
|
292
|
-
|
341
|
+
end
|
342
|
+
it "should request the correct resource" do
|
343
|
+
@search.timeline("twitter")
|
293
344
|
1.upto(16).each do |page|
|
294
345
|
a_get("/1/statuses/home_timeline.json").
|
295
346
|
with(:query => {:count => "200", :page => "#{page}"}).
|
@@ -297,59 +348,60 @@ describe T::Search do
|
|
297
348
|
end
|
298
349
|
end
|
299
350
|
it "should have the correct output" do
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
319
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
320
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
321
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
322
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
323
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
324
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
325
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
326
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
327
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
328
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
329
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
330
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
331
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
332
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
333
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
334
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
335
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
336
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
337
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
338
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
351
|
+
@search.timeline("twitter")
|
352
|
+
$stdout.string.should == <<-eos
|
353
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
354
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
355
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
356
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
357
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
358
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
359
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
360
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
361
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
362
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
363
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
364
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
365
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
366
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
367
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
368
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
339
369
|
eos
|
340
370
|
end
|
371
|
+
context "--long" do
|
372
|
+
before do
|
373
|
+
@search.options = @search.options.merge(:long => true)
|
374
|
+
end
|
375
|
+
it "should list in long format" do
|
376
|
+
@search.timeline("twitter")
|
377
|
+
$stdout.string.should == <<-eos
|
378
|
+
ID Posted at Screen name Text
|
379
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
380
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
381
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
382
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
383
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
384
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
385
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
386
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
387
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
388
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
389
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
390
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
391
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
392
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
393
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
394
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
395
|
+
eos
|
396
|
+
end
|
397
|
+
end
|
341
398
|
context "Twitter is down" do
|
342
399
|
it "should retry 3 times and then raise an error" do
|
343
|
-
1.upto(15).each do |page|
|
344
|
-
stub_get("/1/statuses/home_timeline.json").
|
345
|
-
with(:query => {:count => "200", :page => "#{page}"}).
|
346
|
-
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
347
|
-
end
|
348
400
|
stub_get("/1/statuses/home_timeline.json").
|
349
401
|
with(:query => {:count => "200", :page => "16"}).
|
350
402
|
to_return(:status => 502)
|
351
403
|
lambda do
|
352
|
-
@
|
404
|
+
@search.timeline("twitter")
|
353
405
|
end.should raise_error("Twitter is down or being upgraded.")
|
354
406
|
a_get("/1/statuses/home_timeline.json").
|
355
407
|
with(:query => {:count => "200", :page => "16"}).
|
@@ -359,13 +411,15 @@ describe T::Search do
|
|
359
411
|
end
|
360
412
|
|
361
413
|
describe "#user" do
|
362
|
-
|
414
|
+
before do
|
363
415
|
1.upto(16).each do |page|
|
364
416
|
stub_get("/1/statuses/user_timeline.json").
|
365
417
|
with(:query => {:screen_name => "sferik", :count => "200", :page => "#{page}"}).
|
366
418
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
367
419
|
end
|
368
|
-
|
420
|
+
end
|
421
|
+
it "should request the correct resource" do
|
422
|
+
@search.user("sferik", "twitter")
|
369
423
|
1.upto(16).each do |page|
|
370
424
|
a_get("/1/statuses/user_timeline.json").
|
371
425
|
with(:query => {:screen_name => "sferik", :count => "200", :page => "#{page}"}).
|
@@ -373,59 +427,60 @@ describe T::Search do
|
|
373
427
|
end
|
374
428
|
end
|
375
429
|
it "should have the correct output" do
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
395
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
396
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
397
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
398
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
399
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
400
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
401
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
402
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
403
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
404
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
405
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
406
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
407
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
408
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
409
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
410
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
411
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
412
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
413
|
-
sferik: 140 Proof Provides A Piece Of The Twitter Advertising Puzzle http://t.co/R2cUSDe via @techcrunch (about 1 year ago)
|
414
|
-
sferik: I know @SarahPalinUSA has a right to use Twitter, but should she? (over 1 year ago)
|
430
|
+
@search.user("sferik", "twitter")
|
431
|
+
$stdout.string.should == <<-eos
|
432
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
433
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
434
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
435
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
436
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
437
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
438
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
439
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
440
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
441
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
442
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
443
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
444
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
445
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
446
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
447
|
+
bartt: @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come. (7 months ago)
|
415
448
|
eos
|
416
449
|
end
|
450
|
+
context "--long" do
|
451
|
+
before do
|
452
|
+
@search.options = @search.options.merge(:long => true)
|
453
|
+
end
|
454
|
+
it "should list in long format" do
|
455
|
+
@search.user("sferik", "twitter")
|
456
|
+
$stdout.string.should == <<-eos
|
457
|
+
ID Posted at Screen name Text
|
458
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
459
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
460
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
461
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
462
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
463
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
464
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
465
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
466
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
467
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
468
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
469
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
470
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
471
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
472
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
473
|
+
194,546,727,670,390,784 Apr 23 2011 bartt @noahlt @gaarf Yup, now owning @twitter -> FB from FE to daemons. Lot’s of fun. Expect improvements in the weeks to come.
|
474
|
+
eos
|
475
|
+
end
|
476
|
+
end
|
417
477
|
context "Twitter is down" do
|
418
478
|
it "should retry 3 times and then raise an error" do
|
419
|
-
1.upto(15).each do |page|
|
420
|
-
stub_get("/1/statuses/user_timeline.json").
|
421
|
-
with(:query => {:screen_name => "sferik", :count => "200", :page => "#{page}"}).
|
422
|
-
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
423
|
-
end
|
424
479
|
stub_get("/1/statuses/user_timeline.json").
|
425
480
|
with(:query => {:screen_name => "sferik", :count => "200", :page => "16"}).
|
426
481
|
to_return(:status => 502)
|
427
482
|
lambda do
|
428
|
-
@
|
483
|
+
@search.user("sferik", "twitter")
|
429
484
|
end.should raise_error("Twitter is down or being upgraded.")
|
430
485
|
a_get("/1/statuses/user_timeline.json").
|
431
486
|
with(:query => {:screen_name => "sferik", :count => "200", :page => "16"}).
|