t 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/spec/rcfile_spec.rb CHANGED
@@ -16,7 +16,7 @@ describe T::RCFile do
16
16
  end
17
17
 
18
18
  describe "#[]" do
19
- it "should return the profiles for a user" do
19
+ it "returns the profiles for a user" do
20
20
  rcfile = T::RCFile.instance
21
21
  rcfile.path = fixture_path + "/.trc"
22
22
  expect(rcfile['testcli'].keys).to eq ['abc123']
@@ -24,7 +24,7 @@ describe T::RCFile do
24
24
  end
25
25
 
26
26
  describe "#[]=" do
27
- it "should add a profile for a user" do
27
+ it "adds a profile for a user" do
28
28
  rcfile = T::RCFile.instance
29
29
  rcfile.path = project_path + "/tmp/trc"
30
30
  rcfile['testcli'] = {
@@ -38,7 +38,7 @@ describe T::RCFile do
38
38
  }
39
39
  expect(rcfile['testcli'].keys).to eq ['abc123']
40
40
  end
41
- it "should write the data to disk" do
41
+ it "writes the data to a file" do
42
42
  rcfile = T::RCFile.instance
43
43
  rcfile.path = project_path + "/tmp/trc"
44
44
  rcfile['testcli'] = {
@@ -52,7 +52,7 @@ describe T::RCFile do
52
52
  }
53
53
  expect(rcfile['testcli'].keys).to eq ['abc123']
54
54
  end
55
- it "should not be world readable or writable" do
55
+ it "is not be world readable or writable" do
56
56
  rcfile = T::RCFile.instance
57
57
  rcfile.path = project_path + "/tmp/trc"
58
58
  rcfile['testcli'] = {
@@ -69,7 +69,7 @@ describe T::RCFile do
69
69
  end
70
70
 
71
71
  describe "#configuration" do
72
- it "should return configuration" do
72
+ it "returns configuration" do
73
73
  rcfile = T::RCFile.instance
74
74
  rcfile.path = fixture_path + "/.trc"
75
75
  expect(rcfile.configuration.keys).to eq ['default_profile']
@@ -77,7 +77,7 @@ describe T::RCFile do
77
77
  end
78
78
 
79
79
  describe "#active_consumer_key" do
80
- it "should return default consumer key" do
80
+ it "returns default consumer key" do
81
81
  rcfile = T::RCFile.instance
82
82
  rcfile.path = fixture_path + "/.trc"
83
83
  expect(rcfile.active_consumer_key).to eq 'abc123'
@@ -85,7 +85,7 @@ describe T::RCFile do
85
85
  end
86
86
 
87
87
  describe "#active_consumer_secret" do
88
- it "should return default consumer secret" do
88
+ it "returns default consumer secret" do
89
89
  rcfile = T::RCFile.instance
90
90
  rcfile.path = fixture_path + "/.trc"
91
91
  expect(rcfile.active_consumer_secret).to eq 'asdfasd223sd2'
@@ -93,7 +93,7 @@ describe T::RCFile do
93
93
  end
94
94
 
95
95
  describe "#active_profile" do
96
- it "should return default profile" do
96
+ it "returns default profile" do
97
97
  rcfile = T::RCFile.instance
98
98
  rcfile.path = fixture_path + "/.trc"
99
99
  expect(rcfile.active_profile).to eq ['testcli', 'abc123']
@@ -101,13 +101,13 @@ describe T::RCFile do
101
101
  end
102
102
 
103
103
  describe "#active_profile=" do
104
- it "should set default profile" do
104
+ it "sets default profile" do
105
105
  rcfile = T::RCFile.instance
106
106
  rcfile.path = project_path + "/tmp/trc"
107
107
  rcfile.active_profile = {'username' => 'testcli', 'consumer_key' => 'abc123'}
108
108
  expect(rcfile.active_profile).to eq ['testcli', 'abc123']
109
109
  end
110
- it "should write the data to disk" do
110
+ it "writes the data to a file" do
111
111
  rcfile = T::RCFile.instance
112
112
  rcfile.path = project_path + "/tmp/trc"
113
113
  rcfile.active_profile = {'username' => 'testcli', 'consumer_key' => 'abc123'}
@@ -116,7 +116,7 @@ describe T::RCFile do
116
116
  end
117
117
 
118
118
  describe "#active_token" do
119
- it "should return default token" do
119
+ it "returns default token" do
120
120
  rcfile = T::RCFile.instance
121
121
  rcfile.path = fixture_path + "/.trc"
122
122
  expect(rcfile.active_token).to eq '428004849-cebdct6bwobn'
@@ -124,7 +124,7 @@ describe T::RCFile do
124
124
  end
125
125
 
126
126
  describe "#active_secret" do
127
- it "should return default secret" do
127
+ it "returns default secret" do
128
128
  rcfile = T::RCFile.instance
129
129
  rcfile.path = fixture_path + "/.trc"
130
130
  expect(rcfile.active_secret).to eq 'epzrjvxtumoc'
@@ -132,7 +132,7 @@ describe T::RCFile do
132
132
  end
133
133
 
134
134
  describe "#delete" do
135
- it "should delete the rcfile" do
135
+ it "deletes the rcfile" do
136
136
  path = project_path + "/tmp/trc"
137
137
  File.open(path, 'w'){|file| file.write(YAML.dump({}))}
138
138
  expect(File.exist?(path)).to be_true
@@ -145,14 +145,14 @@ describe T::RCFile do
145
145
 
146
146
  describe "#empty?" do
147
147
  context "when a non-empty file exists" do
148
- it "should return false" do
148
+ it "returns false" do
149
149
  rcfile = T::RCFile.instance
150
150
  rcfile.path = fixture_path + "/.trc"
151
151
  expect(rcfile.empty?).to be_false
152
152
  end
153
153
  end
154
154
  context "when file does not exist at path" do
155
- it "should return true" do
155
+ it "returns true" do
156
156
  rcfile = T::RCFile.instance
157
157
  rcfile.path = File.expand_path('../fixtures/foo', __FILE__)
158
158
  expect(rcfile.empty?).to be_true
@@ -162,14 +162,14 @@ describe T::RCFile do
162
162
 
163
163
  describe "#load_file" do
164
164
  context "when file exists at path" do
165
- it "should load data from file" do
165
+ it "loads data from file" do
166
166
  rcfile = T::RCFile.instance
167
167
  rcfile.path = fixture_path + "/.trc"
168
168
  expect(rcfile.load_file['profiles']['testcli']['abc123']['username']).to eq 'testcli'
169
169
  end
170
170
  end
171
171
  context "when file does not exist at path" do
172
- it "should load default structure" do
172
+ it "loads default structure" do
173
173
  rcfile = T::RCFile.instance
174
174
  rcfile.path = File.expand_path('../fixtures/foo', __FILE__)
175
175
  expect(rcfile.load_file.keys.sort).to eq ['configuration', 'profiles']
@@ -178,18 +178,18 @@ describe T::RCFile do
178
178
  end
179
179
 
180
180
  describe "#path" do
181
- it "should default to ~/.trc" do
181
+ it "defaults to ~/.trc" do
182
182
  expect(T::RCFile.instance.path).to eq File.join(File.expand_path('~'), '.trc')
183
183
  end
184
184
  end
185
185
 
186
186
  describe "#path=" do
187
- it "should override path" do
187
+ it "overrides path" do
188
188
  rcfile = T::RCFile.instance
189
189
  rcfile.path = project_path + "/tmp/trc"
190
190
  expect(rcfile.path).to eq project_path + "/tmp/trc"
191
191
  end
192
- it "should reload data" do
192
+ it "reloads data" do
193
193
  rcfile = T::RCFile.instance
194
194
  rcfile.path = fixture_path + "/.trc"
195
195
  expect(rcfile['testcli']['abc123']['username']).to eq 'testcli'
@@ -197,7 +197,7 @@ describe T::RCFile do
197
197
  end
198
198
 
199
199
  describe "#profiles" do
200
- it "should return profiles" do
200
+ it "returns profiles" do
201
201
  rcfile = T::RCFile.instance
202
202
  rcfile.path = fixture_path + "/.trc"
203
203
  expect(rcfile.profiles.keys).to eq ['testcli']
data/spec/search_spec.rb CHANGED
@@ -30,154 +30,518 @@ describe T::Search do
30
30
 
31
31
  describe "#all" do
32
32
  before do
33
- stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :rpp => "20"}).to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
34
- stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :max_id => "246666260270702591", :rpp => "16"}).to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
35
- stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :max_id => "246666260270702591", :rpp => "12"}).to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
36
- stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :max_id => "246666260270702591", :rpp => "8"}).to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
37
- stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :max_id => "246666260270702591", :rpp => "4"}).to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
33
+ stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :count => "20"}).to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
38
34
  end
39
- it "should request the correct resource" do
35
+ it "requests the correct resource" do
40
36
  @search.all("twitter")
41
- expect(a_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :rpp => "20"})).to have_been_made
42
- expect(a_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :max_id => "246666260270702591", :rpp => "16"})).to have_been_made
43
- expect(a_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :max_id => "246666260270702591", :rpp => "12"})).to have_been_made
44
- expect(a_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :max_id => "246666260270702591", :rpp => "8"})).to have_been_made
45
- expect(a_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :max_id => "246666260270702591", :rpp => "4"})).to have_been_made
37
+ expect(a_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :count => "20"})).to have_been_made
46
38
  end
47
- it "should have the correct output" do
39
+ it "has the correct output" do
48
40
  @search.all("twitter")
49
41
  expect($stdout.string).to eq <<-eos
50
42
 
51
- \e[1m\e[33m @richrad\e[0m
52
- Bubble Mailer #freebandnames
43
+ \e[1m\e[33m @saintsday998\e[0m
44
+ Murray Energy Corp. Obama Reelection, Announces Layoffs http://t.co/D1OPtKnw
45
+ via @HuffPostBiz MAYBE his workers can do something for him ?
53
46
 
54
- \e[1m\e[33m @dswordsNshields\e[0m
55
- Hair of the Frog
47
+ \e[1m\e[33m @thlyons\e[0m
48
+ Obama Administration Extends Deadline For State Exchanges - Kaiser Health
49
+ News http://t.co/dyaM4jF1
56
50
 
57
- (seriously, think about it)
51
+ \e[1m\e[33m @justmaryse\e[0m
52
+ Fox News accidentally insults the intelligence of every Mitt Romney voter in
53
+ the country. http://t.co/sQbt16RF via @HappyPlace #awkward
58
54
 
59
- #freebandnames
55
+ \e[1m\e[33m @BlueTrooth\e[0m
56
+ RT @AntiWacko: It's hilarious to watch the Conservatives getting hysterical
57
+ about Pres Obama's re-election. #p2 #tcot
60
58
 
61
- \e[1m\e[33m @thedunniebobos\e[0m
62
- Wussies and pussies #goddylan #freebandnames
59
+ \e[1m\e[33m @robbiegleeson\e[0m
60
+ RT @Revolution_IRL: RT if you agree its insane that tubridy gets paid more
61
+ than obama #LateLate
63
62
 
64
- \e[1m\e[33m @StrongPROGress\e[0m
65
- #FreeBandNames Asterisks and Thunderstorms
63
+ \e[1m\e[33m @melinwy\e[0m
64
+ RT @Kristina_x_x: GOP enthusiasm, was higher, registration was higher, crowds
65
+ larger, intensity larger. yet Obama won. Hmmmm @mittromney
66
66
 
67
- \e[1m\e[33m @richrad\e[0m
68
- Bubble Mailer #freebandnames
67
+ \e[1m\e[33m @WANT1DTOFOLLOWU\e[0m
68
+ RT @LoveYungCotta: Romney talks about Obama. Obama talks about the nation.
69
+ Romney says "I." Obama says "We." Pay attention to the small things.
70
+ #voteobama
69
71
 
70
- \e[1m\e[33m @dswordsNshields\e[0m
71
- Hair of the Frog
72
+ \e[1m\e[33m @bodysouls\e[0m
73
+ @RealJonLovitz Did u see this? Barbara Teixeira@BarbArn
72
74
 
73
- (seriously, think about it)
75
+ OBAMA REELECTION TRIGGERS MASSIVE LAYOFFS ACROSS AMERICA http://t.co/kfuILrmE
76
+
74
77
 
75
- #freebandnames
78
+ \e[1m\e[33m @tinasebring\e[0m
79
+ RT @ken24xavier: YES OBAMA we really really believe CIA Director Petraeus
80
+ Resigns... over extramarital affair? OH LOOK cows flying over the Moon
76
81
 
77
- \e[1m\e[33m @thedunniebobos\e[0m
78
- Wussies and pussies #goddylan #freebandnames
82
+ \e[1m\e[33m @OD_Worrell\e[0m
83
+ RT @AP: White House says #Obama will travel to New York on Thursday to view
84
+ recovery efforts from Superstorm Sandy: http://t.co/MCS6MceM
79
85
 
80
- \e[1m\e[33m @StrongPROGress\e[0m
81
- #FreeBandNames Asterisks and Thunderstorms
86
+ \e[1m\e[33m @LathamChalaGrp\e[0m
87
+ Obama Hangs Tough on the Fiscal Cliff His speech increases the likelihood
88
+ that negotiations will drag on well into 2013
82
89
 
83
- \e[1m\e[33m @richrad\e[0m
84
- Bubble Mailer #freebandnames
90
+ \e[1m\e[33m @sesto09\e[0m
91
+ La lettera di Obama sui genitori gay http://t.co/dmFkfbgG
85
92
 
86
- \e[1m\e[33m @dswordsNshields\e[0m
87
- Hair of the Frog
93
+ \e[1m\e[33m @NickLoveSlayer\e[0m
94
+ RT @NewsMCyrus: Después De que gano Obama las elecciones, empezó a sonar
95
+ Party In The U.S.A de Miley Cyrus en la casa blanca
88
96
 
89
- (seriously, think about it)
97
+ \e[1m\e[33m @Ch_pavon17\e[0m
98
+ RT @PrincipeWilli: -Hoy me desperté bien electo. -Jajaja, pinche Obama, eres
99
+ un desmadre..
90
100
 
91
- #freebandnames
101
+ \e[1m\e[33m @weeki1\e[0m
102
+ RT @jjauthor: #Navy names newest ship - USS Barack Obama #GoNavy
103
+ http://t.co/F6PGNTjX
92
104
 
93
- \e[1m\e[33m @thedunniebobos\e[0m
94
- Wussies and pussies #goddylan #freebandnames
105
+ \e[1m\e[33m @LugosLove\e[0m
106
+ Wow, Obama Started Crying While He Was Giving A Speech To His Campaign Staff
95
107
 
96
- \e[1m\e[33m @StrongPROGress\e[0m
97
- #FreeBandNames Asterisks and Thunderstorms
108
+ \e[1m\e[33m @jbrons\e[0m
109
+ RT @dwiskus: Obama played OHIO to win 26-24. http://t.co/CEW5XMtc
98
110
 
99
- \e[1m\e[33m @richrad\e[0m
100
- Bubble Mailer #freebandnames
111
+ \e[1m\e[33m @Moondances_\e[0m
112
+ RT @_pedropenna: OBAMA teve o tweet mais retweetado da história aí é óbvio
113
+ que as fãs do justin vão falar: VAMOS BATER ESSE
114
+ RECORDDDDDDDDDDDDDDDDDDDDDDDDDDDD
101
115
 
102
- \e[1m\e[33m @dswordsNshields\e[0m
103
- Hair of the Frog
116
+ \e[1m\e[33m @matthew_austin4\e[0m
117
+ No, I will not shut up. I don't like Obama. I will continue to tweet my mind.
104
118
 
105
- (seriously, think about it)
119
+ \e[1m\e[33m @FreebirdForever\e[0m
120
+ RT @Bobprintdoc: @vickikellar vicki your overdrawn on your Obama bashing
121
+ account please insert 16,000,000,000,000 dollars or whatever the national
122
+ debt is
106
123
 
107
- #freebandnames
124
+ \e[1m\e[33m @_WHOOPdefckindo\e[0m
125
+ RT @RiIeyJokess: ME: who you voting for? WHITE PEOPLE: I rather not discuss
126
+ that with you.
108
127
 
109
- \e[1m\e[33m @thedunniebobos\e[0m
110
- Wussies and pussies #goddylan #freebandnames
128
+ ME: who you voting for?? BLACK PEOPLE: TF U MEAN?? OBAMA N*GGA!
111
129
 
112
- \e[1m\e[33m @StrongPROGress\e[0m
113
- #FreeBandNames Asterisks and Thunderstorms
130
+ \e[1m\e[33m @nikkipjah\e[0m
131
+ #Obama's track record with #HumanRights http://t.co/fTrjJHtB
114
132
 
115
- \e[1m\e[33m @richrad\e[0m
116
- Bubble Mailer #freebandnames
133
+ \e[1m\e[33m @pandphomemades\e[0m
134
+ RT @JewPublican: Think about it. All of big Hollywood supported obama.
135
+ Everything we see now is pretty much out of movies. Truth is Stranger than
136
+ Fiction!
117
137
 
118
- \e[1m\e[33m @dswordsNshields\e[0m
119
- Hair of the Frog
138
+ \e[1m\e[33m @Vita__Nova\e[0m
139
+ Bunda rus-israil ittifakının etkisi çok büyük. Obama ilk ziyaretini
140
+ Türkiye'ye yapmayacak. Yoksa hedef tahtasında olur.
120
141
 
121
- (seriously, think about it)
142
+ \e[1m\e[33m @tv6tnt\e[0m
143
+ White House says Obama will travel to New York on Thursday to view recovery
144
+ efforts from Superstorm Sandy
122
145
 
123
- #freebandnames
146
+ \e[1m\e[33m @ricardo126234\e[0m
147
+ @Jacquie0415 @gregwhoward obama is not a muslim. Whatever fox news channel
148
+ you got that from was lying to you.
124
149
 
125
- \e[1m\e[33m @thedunniebobos\e[0m
126
- Wussies and pussies #goddylan #freebandnames
150
+ \e[1m\e[33m @LifesaBishh\e[0m
151
+ RT @SomeoneBelow: The person below is complaining about Obama.
127
152
 
128
- \e[1m\e[33m @StrongPROGress\e[0m
129
- #FreeBandNames Asterisks and Thunderstorms
153
+ \e[1m\e[33m @I_Fuk_Wid_OBAMA\e[0m
154
+ :) #Pixect http://t.co/jZxz8JeC
130
155
 
131
- eos
132
- end
133
- context "--csv" do
134
- before do
135
- @search.options = @search.options.merge("csv" => true)
136
- end
137
- it "should output in CSV format" do
138
- @search.all("twitter")
139
- expect($stdout.string).to eq <<-eos
140
- ID,Posted at,Screen name,Text
141
- 247827742178021376,2012-09-17 22:41:52 +0000,richrad,Bubble Mailer #freebandnames
142
- 247811706061979648,2012-09-17 21:38:09 +0000,dswordsNshields,"Hair of the Frog
156
+ \e[1m\e[33m @llParadisell\e[0m
157
+ Why Libya Cover-Up: Obama Was Arming Al Qaeda & Islamists
158
+ http://t.co/erdKx6HD
159
+
160
+ \e[1m\e[33m @naiburnwoood\e[0m
161
+ RT @StephenAtHome: I still can't believe Obama won. I will do everything in
162
+ my power to make sure this is his LAST term as president!
163
+
164
+ \e[1m\e[33m @Neo_Sweetness\e[0m
165
+ RT @5oodaysofautumn: #Obama crying choked me up NEVER SEEN A PRES DO THAT. U
166
+ CAN TELL HIS INTENTIONS ARE IN THE RIGHT PLACE TO LEAD http://t.co/oez0ySOl
167
+
168
+ \e[1m\e[33m @vcAraceli\e[0m
169
+ RT @jusxy: Obama what's my name? Obama what's my name? OBAMA what's my name?
170
+ what's my name? .... #OBALIEN what's my name
171
+
172
+ \e[1m\e[33m @notsoslimshadys\e[0m
173
+ RT @harrynstuff: I bet one day stalker sarah stalks her way into the white
174
+ house she'll just take a picture from Obama's bedroom
175
+
176
+ \e[1m\e[33m @ThinksLogical\e[0m
177
+ RT @dlb703: The difference between Romney and Obama supporters? Romney's look
178
+ like they just got out of church. Obama's look like they're out on parole.
179
+
180
+ \e[1m\e[33m @pabloirossi\e[0m
181
+ Obama, ante el precipicio fiscal: “Tengo mi bolígrafo listo para firmar”
182
+ http://t.co/m5Q6O0lq vía @expansioncom
183
+
184
+ \e[1m\e[33m @mermaid6590\e[0m
185
+ @LeslieMHooper I think Obama and Chris Christie are having an affair! LMAO!!!
186
+
187
+ \e[1m\e[33m @n_mariee3\e[0m
188
+ RT @SAMhOes: Lmao #Obama http://t.co/uxLqQ8zq
189
+
190
+ \e[1m\e[33m @soso2583\e[0m
191
+ RT @20Minutes: Pour Obama, les Américains les plus riches doivent payer plus
192
+ d'impôts http://t.co/PiZXc0Ty
193
+
194
+ \e[1m\e[33m @desertkev\e[0m
195
+ @k_m_allan I'm more about #Obama being banished.
196
+
197
+ \e[1m\e[33m @blakecallaway\e[0m
198
+ yo why did obama have to win
199
+
200
+ \e[1m\e[33m @AlondraMiaa\e[0m
201
+ RT @FaithOn1D: "Las hijas de Obama conocieron a los Jonas, a Justin Bieber y
202
+ ahora conocerán a One Direction" @BarackObama ¡HOLA PAPIIIIIIIIIII!
203
+
204
+ \e[1m\e[33m @4iHD\e[0m
205
+ Szef CIA zrezygnował przez romans. Obama "trzyma kciuki za niego i żonę"
206
+ http://t.co/XiPB0RSW
207
+
208
+ \e[1m\e[33m @fcukjessi\e[0m
209
+ RT @JosieNelson7: Obama yeehaw http://t.co/DJxtDlAk
210
+
211
+ \e[1m\e[33m @Evilazio\e[0m
212
+ Obama "decepciona" mercados. Idiotice! Os mercados estão sendo movidos pela
213
+ China, que retoma crescimento. Só os ricos estão preocupados.
214
+
215
+ \e[1m\e[33m @carolynedgar\e[0m
216
+ @GoAngelo let's just speculate that Petraeus was having an affair WITH Obama
217
+ and they conspired during pillow talk to cover up Benghazi.
218
+
219
+ \e[1m\e[33m @bob_mor\e[0m
220
+ RT @NoticiasCaracol: Obama acepta renuncia del director de la CIA, que deja
221
+ el cargo tras reconocer que tuvo relación extramatrimonial
222
+ http://t.co/uU6j0p7q
223
+
224
+ \e[1m\e[33m @NotBarack\e[0m
225
+ FEMA Failed/Obama Hailed #Sandy #tcot #obama
226
+
227
+ \e[1m\e[33m @georgiaokeeffex\e[0m
228
+ Obama
229
+
230
+ \e[1m\e[33m @LLW83\e[0m
231
+ RT @TheDailyEdge: Obama has a mandate to raise taxes on top 2% to Clinton-era
232
+ levels. To stop him, the "anti-tax" GOP will raise taxes on 100% of us
233
+ #insanity
234
+
235
+ \e[1m\e[33m @aylin_arellanoo\e[0m
236
+ RT @lupiss14: - Ya viste que gano el PRI en EU? -¿El PRI? - Si, el PRIeto de
237
+ Obama.
238
+
239
+ \e[1m\e[33m @ASyrupp\e[0m
240
+ @realDonaldTrump hey idiot-obama won pop. vote&electoral. What's the baby
241
+ with the toupee crying bout? U Deleted revolution tweet? Coward
242
+
243
+ \e[1m\e[33m @JConason\e[0m
244
+ RT @HuffingtonPost: CEO who forced workers to attend Romney rally now
245
+ promises layoffs http://t.co/nZ15MB9x
246
+
247
+ \e[1m\e[33m @hwain_96\e[0m
248
+ RT @_Ken_barlow_: Cameron: "I look forward to working with Obama for the next
249
+ four years." 2 years Dave, 2 years.
250
+
251
+ \e[1m\e[33m @shetrulylovedya\e[0m
252
+ até o obama e a família dançam o gangnam style...
253
+
254
+ \e[1m\e[33m @r9mcgon\e[0m
255
+ RT @Mike_hugs: Nixon +Kissinger tested the theory that if you bomb a country
256
+ and risk no U.S. lives the anti-war movement fizzles. Obama proved it
257
+ correct.
258
+
259
+ \e[1m\e[33m @skew11\e[0m
260
+ RT @RepJeffDuncan: 102 miners laid off in Utah as a direct result of
261
+ President Obama's policies. http://t.co/35lZ7Zmv
262
+
263
+ \e[1m\e[33m @ayyuradita\e[0m
264
+ Congratulation for barack obama [pic] — http://t.co/OJy8DE6T
265
+
266
+ \e[1m\e[33m @homeoffice_biz\e[0m
267
+ Hugo Chavez Offers Obama Some Advice: Fresh off his own reelection,
268
+ Venezuelan President Hugo Chavez has a stron... http://t.co/HD7dUzVg
143
269
 
144
- (seriously, think about it)
270
+ \e[1m\e[33m @donthebear\e[0m
271
+ Bone head and Google eys would not answer the POTUS phone call!
272
+ http://t.co/rra6QAiw
145
273
 
146
- #freebandnames"
147
- 246825473785606145,2012-09-15 04:19:13 +0000,thedunniebobos,Wussies and pussies #goddylan #freebandnames
148
- 246666260270702592,2012-09-14 17:46:33 +0000,StrongPROGress,#FreeBandNames Asterisks and Thunderstorms
149
- 247827742178021376,2012-09-17 22:41:52 +0000,richrad,Bubble Mailer #freebandnames
150
- 247811706061979648,2012-09-17 21:38:09 +0000,dswordsNshields,"Hair of the Frog
274
+ \e[1m\e[33m @Imercuryinfo\e[0m
275
+ 9% Inflation, Obama Care, fewer rights in our socialist future even if Romney
276
+ had won. http://t.co/0ZAO8Xv6
151
277
 
152
- (seriously, think about it)
278
+ \e[1m\e[33m @lege_atque_lacr\e[0m
279
+ Obama holds firm to tax hikes (That is his DNA) http://t.co/TgRk59ir via
280
+ @foxbusiness
153
281
 
154
- #freebandnames"
155
- 246825473785606145,2012-09-15 04:19:13 +0000,thedunniebobos,Wussies and pussies #goddylan #freebandnames
156
- 246666260270702592,2012-09-14 17:46:33 +0000,StrongPROGress,#FreeBandNames Asterisks and Thunderstorms
157
- 247827742178021376,2012-09-17 22:41:52 +0000,richrad,Bubble Mailer #freebandnames
158
- 247811706061979648,2012-09-17 21:38:09 +0000,dswordsNshields,"Hair of the Frog
282
+ \e[1m\e[33m @vldpopov\e[0m
283
+ So, selling Obama is similar to selling yoghurts - Secret Data Crunchers Who
284
+ Helped Obama Win http://t.co/dt5w3xuE via @TIMEPolitics
159
285
 
160
- (seriously, think about it)
286
+ \e[1m\e[33m @DanieMilli_anne\e[0m
287
+ then they really wanna argue about it..like what you mad at? Obama is
288
+ president don't waste your emotion.
161
289
 
162
- #freebandnames"
163
- 246825473785606145,2012-09-15 04:19:13 +0000,thedunniebobos,Wussies and pussies #goddylan #freebandnames
164
- 246666260270702592,2012-09-14 17:46:33 +0000,StrongPROGress,#FreeBandNames Asterisks and Thunderstorms
165
- 247827742178021376,2012-09-17 22:41:52 +0000,richrad,Bubble Mailer #freebandnames
166
- 247811706061979648,2012-09-17 21:38:09 +0000,dswordsNshields,"Hair of the Frog
290
+ \e[1m\e[33m @Says_The_King\e[0m
291
+ I got me an Obama momma. She always be puttin some free money in my account
167
292
 
168
- (seriously, think about it)
293
+ \e[1m\e[33m @Tatts_N_Dreads\e[0m
294
+ RT @CNNMoney: Gun sales are up after Obama's reelection, driven by fears of
295
+ tighter regulation, especially for assault weapons. http://t.co/KEOgWSG9
169
296
 
170
- #freebandnames"
171
- 246825473785606145,2012-09-15 04:19:13 +0000,thedunniebobos,Wussies and pussies #goddylan #freebandnames
172
- 246666260270702592,2012-09-14 17:46:33 +0000,StrongPROGress,#FreeBandNames Asterisks and Thunderstorms
173
- 247827742178021376,2012-09-17 22:41:52 +0000,richrad,Bubble Mailer #freebandnames
174
- 247811706061979648,2012-09-17 21:38:09 +0000,dswordsNshields,"Hair of the Frog
297
+ \e[1m\e[33m @mensadude\e[0m
298
+ Ron Paul: Election shows U.S. 'far gone' http://t.co/CQoYn2iQ #tcot #teaparty
299
+ #ronpaul #unemployment #deficit #jobs #gop #USHOUSE #OBAMA
175
300
 
176
- (seriously, think about it)
301
+ \e[1m\e[33m @IKrUsHiNsKi\e[0m
302
+ @britney_brinae lol move to Canada if u like Obama sorry this countries not
303
+ socialist. Ignorance at its finest.
177
304
 
178
- #freebandnames"
179
- 246825473785606145,2012-09-15 04:19:13 +0000,thedunniebobos,Wussies and pussies #goddylan #freebandnames
180
- 246666260270702592,2012-09-14 17:46:33 +0000,StrongPROGress,#FreeBandNames Asterisks and Thunderstorms
305
+ \e[1m\e[33m @mgracer514\e[0m
306
+ @SpeakerBoehner Do NOT give in To Obama John!!! He and Harry Reid KNOW
307
+ raising taxes on the job creators will not create more tax revenue!!!
308
+
309
+ \e[1m\e[33m @leenpaape\e[0m
310
+ RT @TheEconomist: Video: Barack Obama looks ahead to four more years and
311
+ China reveals its next leaders http://t.co/qpho3KlS
312
+
313
+ \e[1m\e[33m @Timmermanscm\e[0m
314
+ RT @__Wieke__: Net als in Nederland, toch?! @NOS: Obama: rijken moeten meer
315
+ belasting betalen http://t.co/gDEN4urK"
316
+
317
+ \e[1m\e[33m @ColeMurdock24\e[0m
318
+ People who like the snow also voted for Obama.
319
+
320
+ \e[1m\e[33m @tbest\e[0m
321
+ Awesome. “@daringfireball: ‘Obama Played OHIO to Win 26-24’:
322
+ http://t.co/D2eP8EKy”
323
+
324
+ \e[1m\e[33m @ibtxhis_SaMone\e[0m
325
+ RT @WeirdFact: President Obama was known to be heavy marijuana smoker in his
326
+ teen and college days. His nickname used to be "Barack Oganja".
327
+
328
+ \e[1m\e[33m @alejandrita_lm\e[0m
329
+ RT @VaneEscobarR: Las hijas de Obama conocieron a los Jonas, a Justin y
330
+ consiguieron primera fila para ver a One Direction ¡OBAMA ADOPTAME!
331
+
332
+ \e[1m\e[33m @stewie64\e[0m
333
+ RT @DanRiehl: How does this work, anyway? Does the media let Obama vet it's
334
+ questions for everyone?
335
+
336
+ \e[1m\e[33m @Evilpa\e[0m
337
+ RT @AACONS: How does Obama's plan to close 1.6M acres of fed land to shale
338
+ development fit in his plan to create jobs? http://t.co/FOYjcxP6 #tcot #acon
339
+
340
+ \e[1m\e[33m @DayKadence\e[0m
341
+ RT @Frances_D: Pundit Press: What Luck! Obama Won Dozens of Cleveland
342
+ Districts... http://t.co/xwWpcpAV
343
+
344
+ \e[1m\e[33m @Mel_DaOne_\e[0m
345
+ Nah, that ain't right RT @julieisthatcool: I'll fuck Obama wife
346
+
347
+ \e[1m\e[33m @Aslans_Girl\e[0m
348
+ Pundit Press: What Luck! Obama Won Dozens of Cleveland Districts...
349
+ http://t.co/aCMvGeUr
350
+
351
+ \e[1m\e[33m @crazyinms\e[0m
352
+ RT @Clickman8: I’m sure PUTIN, HUGO,CASTRO & AhMADinejad are thrilled over
353
+ the outcome of the Election! OBAMA fits quite nicely in2 their Circle of
354
+ Friends
355
+
356
+ \e[1m\e[33m @JaeGun_LaoLin\e[0m
357
+ RT @Kennyment: POURQUOI VOUS INVENTEZ DES PAIRINGS COMME ÇA ? LE PIRE QUE
358
+ J'AI VU DE TOUTE MA VIE C'ÉTAIT OBATAE. OBAMA/TAEMIN.
359
+
360
+ \e[1m\e[33m @borealizz\e[0m
361
+ RT @utaustinliberal: Jake Tapper demands Carney release a tick-tock of where
362
+ Pres. Obama was during the Benghazi attack. Shorter Carney: Who the f**k are
363
+ you?
364
+
365
+ \e[1m\e[33m @justessheather\e[0m
366
+ My uncle posted a picture on facebook of seagulls on a shore and said it was
367
+ "Obama's supporters waiting for their handouts" lmfao I can't.
368
+
369
+ \e[1m\e[33m @maxD_ooUt\e[0m
370
+ “@JennaNanci: My family is fucked because Obama is the president.” Join the
371
+ club
372
+
373
+ \e[1m\e[33m @KacyleneS\e[0m
374
+ RT @ArsheanaLaNesha: White gyrls yall fucking black nigghas so stop riding
375
+ OBAMA DICK DAMN
376
+
377
+ \e[1m\e[33m @Imercuryinfo\e[0m
378
+ I uploaded a @YouTube video http://t.co/BgQkRT5u 9% Inflation, Obama Care,
379
+ fewer rights in our socialist future even if Romney had
380
+
381
+ \e[1m\e[33m @MuslimGeezer\e[0m
382
+ Aung San Suu Kyi initially opposed Obama’s Burma trip http://t.co/rntYv65C
383
+
384
+ \e[1m\e[33m @MDiPasquale1999\e[0m
385
+ @MarciaCM1 @royparrish of course Obama accepted his resignation because he
386
+ wrote his "resignation."
387
+
388
+ \e[1m\e[33m @TigerBaby84\e[0m
389
+ RT @BreitbartNews: Obama: No Deal Without Tax Hikes: The lines are now set
390
+ for the battle over the fiscal cliff. The fiscal cliff, ...
391
+ http://t.co/YDHgzwFE
392
+
393
+ \e[1m\e[33m @CriticalMassTX\e[0m
394
+ RT @thinkprogress: The 6 best overreactions to Obama’s win. watch Glenn
395
+ Beck's rant. spooky shit http://t.co/sZfQkkLd via @ARStrasser #icymi
396
+
397
+ \e[1m\e[33m @cobe001001\e[0m
398
+ RT @whitehouse: President Obama: "I’m committed to solving our fiscal
399
+ challenges. But I refuse to accept any approach that isn’t balanced."
400
+
401
+ \e[1m\e[33m @MeganPanatier\e[0m
402
+ City of Obama to invite Obama to Japan - The Tokyo Times http://t.co/1SwafGOM
403
+ via @TheTokyoTimes
404
+
405
+ \e[1m\e[33m @Katie_janca\e[0m
406
+ RT @140elect: Hillary Clinton has said for years she wont serve in Obama's
407
+ second term. Now if/when she resigns #Benghazi conspiracists will go crazy.
408
+
409
+ \e[1m\e[33m @Linapooh1\e[0m
410
+ Sumbody had to do it!! The Obama Car! http://t.co/NLSrOT4A
411
+
412
+ \e[1m\e[33m @cinrui\e[0m
413
+ RT @SeanKCarter: Oliver Stone "I find Obama scary!" So do we Mr. Stone, so do
414
+ we... http://t.co/39YIdQkq #tcot
415
+
416
+ \e[1m\e[33m @nthowa2\e[0m
417
+ Obama in a cover up folks! Are we this dumb? CIA Director Petraeus Resigns
418
+ Over 'Affair' http://t.co/ZKu297Gz via @BreitbartNews
419
+
420
+ \e[1m\e[33m @dirtyvic_1\e[0m
421
+ @glennbeck @seahannity Commander Fitzpatrick Files Treason Charges Against
422
+ Barack Obama #teaparty #UT #Election http://t.co/T9GHyUZ4
423
+
424
+ \e[1m\e[33m @SteveCaruso\e[0m
425
+ Great election background....http://t.co/HwdVs40N
426
+
427
+ eos
428
+ end
429
+ context "--csv" do
430
+ before do
431
+ @search.options = @search.options.merge("csv" => true)
432
+ end
433
+ it "outputs in CSV format" do
434
+ @search.all("twitter")
435
+ expect($stdout.string).to eq <<-eos
436
+ ID,Posted at,Screen name,Text
437
+ 267024754278539266,2012-11-09 22:03:57 +0000,saintsday998,"Murray Energy Corp. Obama Reelection, Announces Layoffs http://t.co/D1OPtKnw via @HuffPostBiz MAYBE his workers can do something for him ?"
438
+ 267024753326448640,2012-11-09 22:03:56 +0000,thlyons,Obama Administration Extends Deadline For State Exchanges - Kaiser Health News http://t.co/dyaM4jF1
439
+ 267024753292869634,2012-11-09 22:03:56 +0000,justmaryse,Fox News accidentally insults the intelligence of every Mitt Romney voter in the country. http://t.co/sQbt16RF via @HappyPlace #awkward
440
+ 267024751854252033,2012-11-09 22:03:56 +0000,BlueTrooth,RT @AntiWacko: It's hilarious to watch the Conservatives getting hysterical about Pres Obama's re-election. #p2 #tcot
441
+ 267024751657115648,2012-11-09 22:03:56 +0000,robbiegleeson,RT @Revolution_IRL: RT if you agree its insane that tubridy gets paid more than obama #LateLate
442
+ 267024751619350528,2012-11-09 22:03:56 +0000,melinwy,"RT @Kristina_x_x: GOP enthusiasm, was higher, registration was higher, crowds larger, intensity larger. yet Obama won. Hmmmm @mittromney"
443
+ 267024751585808384,2012-11-09 22:03:56 +0000,WANT1DTOFOLLOWU,"RT @LoveYungCotta: Romney talks about Obama. Obama talks about the nation. Romney says ""I."" Obama says ""We."" Pay attention to the small things. #voteobama"
444
+ 267024751321575424,2012-11-09 22:03:56 +0000,bodysouls,"@RealJonLovitz Did u see this? Barbara Teixeira@BarbArn
445
+
446
+ OBAMA REELECTION TRIGGERS MASSIVE LAYOFFS ACROSS AMERICA http://t.co/kfuILrmE …"
447
+ 267024750109396993,2012-11-09 22:03:56 +0000,tinasebring,RT @ken24xavier: YES OBAMA we really really believe CIA Director Petraeus Resigns... over extramarital affair? OH LOOK cows flying over the Moon
448
+ 267024749979373568,2012-11-09 22:03:56 +0000,OD_Worrell,RT @AP: White House says #Obama will travel to New York on Thursday to view recovery efforts from Superstorm Sandy: http://t.co/MCS6MceM
449
+ 267024749622865921,2012-11-09 22:03:56 +0000,LathamChalaGrp,Obama Hangs Tough on the Fiscal Cliff His speech increases the likelihood that negotiations will drag on well into 2013
450
+ 267024749501218817,2012-11-09 22:03:56 +0000,sesto09,La lettera di Obama sui genitori gay http://t.co/dmFkfbgG
451
+ 267024748779819009,2012-11-09 22:03:55 +0000,NickLoveSlayer,"RT @NewsMCyrus: Después De que gano Obama las elecciones, empezó a sonar Party In The U.S.A de Miley Cyrus en la casa blanca"
452
+ 267024748536541185,2012-11-09 22:03:55 +0000,Ch_pavon17,"RT @PrincipeWilli: -Hoy me desperté bien electo.
453
+ -Jajaja, pinche Obama, eres un desmadre.."
454
+ 267024746821058560,2012-11-09 22:03:55 +0000,weeki1,RT @jjauthor: #Navy names newest ship - USS Barack Obama #GoNavy http://t.co/F6PGNTjX
455
+ 267024746724605952,2012-11-09 22:03:55 +0000,LugosLove,"Wow, Obama Started Crying While He Was Giving A Speech To His Campaign Staff"
456
+ 267024746389061633,2012-11-09 22:03:55 +0000,jbrons,RT @dwiskus: Obama played OHIO to win 26-24. http://t.co/CEW5XMtc
457
+ 267024746372268032,2012-11-09 22:03:55 +0000,Moondances_,RT @_pedropenna: OBAMA teve o tweet mais retweetado da história aí é óbvio que as fãs do justin vão falar: VAMOS BATER ESSE RECORDDDDDDDDDDDDDDDDDDDDDDDDDDDD
458
+ 267024745642463233,2012-11-09 22:03:55 +0000,matthew_austin4,"No, I will not shut up. I don't like Obama. I will continue to tweet my mind."
459
+ 267024745546014720,2012-11-09 22:03:55 +0000,FreebirdForever,"RT @Bobprintdoc: @vickikellar vicki your overdrawn on your Obama bashing account please insert 16,000,000,000,000 dollars or whatever the national debt is"
460
+ 267024744673587201,2012-11-09 22:03:54 +0000,_WHOOPdefckindo,"RT @RiIeyJokess: ME: who you voting for?
461
+ WHITE PEOPLE: I rather not discuss that with you.
462
+
463
+ ME: who you voting for??
464
+ BLACK PEOPLE: TF U MEAN?? OBAMA N*GGA!"
465
+ 267024743629209601,2012-11-09 22:03:54 +0000,nikkipjah,"#Obama's track record with #HumanRights
466
+ http://t.co/fTrjJHtB"
467
+ 267024743323033600,2012-11-09 22:03:54 +0000,pandphomemades,RT @JewPublican: Think about it. All of big Hollywood supported obama. Everything we see now is pretty much out of movies. Truth is Stranger than Fiction!
468
+ 267024742899412992,2012-11-09 22:03:54 +0000,Vita__Nova,Bunda rus-israil ittifakının etkisi çok büyük. Obama ilk ziyaretini Türkiye'ye yapmayacak. Yoksa hedef tahtasında olur.
469
+ 267024742295416832,2012-11-09 22:03:54 +0000,tv6tnt,White House says Obama will travel to New York on Thursday to view recovery efforts from Superstorm Sandy
470
+ 267024742257680386,2012-11-09 22:03:54 +0000,ricardo126234,@Jacquie0415 @gregwhoward obama is not a muslim. Whatever fox news channel you got that from was lying to you.
471
+ 267024741381074944,2012-11-09 22:03:54 +0000,LifesaBishh,RT @SomeoneBelow: The person below is complaining about Obama.
472
+ 267024740810637313,2012-11-09 22:03:54 +0000,I_Fuk_Wid_OBAMA,:) #Pixect http://t.co/jZxz8JeC
473
+ 267024740760289280,2012-11-09 22:03:53 +0000,llParadisell,"Why Libya Cover-Up: Obama Was Arming Al Qaeda & Islamists
474
+ http://t.co/erdKx6HD"
475
+ 267024739627839488,2012-11-09 22:03:53 +0000,naiburnwoood,RT @StephenAtHome: I still can't believe Obama won. I will do everything in my power to make sure this is his LAST term as president!
476
+ 267024738927394816,2012-11-09 22:03:53 +0000,Neo_Sweetness,RT @5oodaysofautumn: #Obama crying choked me up NEVER SEEN A PRES DO THAT. U CAN TELL HIS INTENTIONS ARE IN THE RIGHT PLACE TO LEAD http://t.co/oez0ySOl
477
+ 267024738906431490,2012-11-09 22:03:53 +0000,vcAraceli,RT @jusxy: Obama what's my name? Obama what's my name? OBAMA what's my name? what's my name? .... #OBALIEN what's my name
478
+ 267024738575065089,2012-11-09 22:03:53 +0000,notsoslimshadys,RT @harrynstuff: I bet one day stalker sarah stalks her way into the white house she'll just take a picture from Obama's bedroom
479
+ 267024738478600192,2012-11-09 22:03:53 +0000,ThinksLogical,RT @dlb703: The difference between Romney and Obama supporters? Romney's look like they just got out of church. Obama's look like they're out on parole.
480
+ 267024737937547264,2012-11-09 22:03:53 +0000,pabloirossi,"Obama, ante el precipicio fiscal: &#8220;Tengo mi bolígrafo listo para firmar&#8221; http://t.co/m5Q6O0lq vía @expansioncom"
481
+ 267024737794945024,2012-11-09 22:03:53 +0000,mermaid6590,@LeslieMHooper I think Obama and Chris Christie are having an affair! LMAO!!!
482
+ 267024737706840064,2012-11-09 22:03:53 +0000,n_mariee3,RT @SAMhOes: Lmao #Obama http://t.co/uxLqQ8zq
483
+ 267024737354534912,2012-11-09 22:03:53 +0000,soso2583,"RT @20Minutes: Pour Obama, les Américains les plus riches doivent payer plus d'impôts http://t.co/PiZXc0Ty"
484
+ 267024736968667136,2012-11-09 22:03:53 +0000,desertkev,@k_m_allan I'm more about #Obama being banished.
485
+ 267024736373063680,2012-11-09 22:03:52 +0000,blakecallaway,yo why did obama have to win
486
+ 267024736108818432,2012-11-09 22:03:52 +0000,AlondraMiaa,"RT @FaithOn1D: ""Las hijas de Obama conocieron a los Jonas, a Justin Bieber y ahora conocerán a One Direction"" @BarackObama ¡HOLA PAPIIIIIIIIIII!"
487
+ 267024735878119424,2012-11-09 22:03:52 +0000,4iHD,"Szef CIA zrezygnował przez romans. Obama ""trzyma kciuki za niego i żonę"" http://t.co/XiPB0RSW"
488
+ 267024735450324993,2012-11-09 22:03:52 +0000,fcukjessi,RT @JosieNelson7: Obama yeehaw http://t.co/DJxtDlAk
489
+ 267024735156703232,2012-11-09 22:03:52 +0000,Evilazio,"Obama ""decepciona"" mercados. Idiotice! Os mercados estão sendo movidos pela China, que retoma crescimento. Só os ricos estão preocupados."
490
+ 267024734628233218,2012-11-09 22:03:52 +0000,carolynedgar,@GoAngelo let's just speculate that Petraeus was having an affair WITH Obama and they conspired during pillow talk to cover up Benghazi.
491
+ 267024734481440769,2012-11-09 22:03:52 +0000,bob_mor,"RT @NoticiasCaracol: Obama acepta renuncia del director de la CIA, que deja el cargo tras reconocer que tuvo relación extramatrimonial http://t.co/uU6j0p7q"
492
+ 267024734464651264,2012-11-09 22:03:52 +0000,NotBarack,FEMA Failed/Obama Hailed #Sandy #tcot #obama
493
+ 267024733319598080,2012-11-09 22:03:52 +0000,georgiaokeeffex,Obama
494
+ 267024733189582849,2012-11-09 22:03:52 +0000,LLW83,"RT @TheDailyEdge: Obama has a mandate to raise taxes on top 2% to Clinton-era levels. To stop him, the ""anti-tax"" GOP will raise taxes on 100% of us #insanity"
495
+ 267024733067943936,2012-11-09 22:03:52 +0000,aylin_arellanoo,"RT @lupiss14: - Ya viste que gano el PRI en EU? -¿El PRI? - Si, el PRIeto de Obama."
496
+ 267024732984053761,2012-11-09 22:03:52 +0000,ASyrupp,@realDonaldTrump hey idiot-obama won pop. vote&electoral. What's the baby with the toupee crying bout? U Deleted revolution tweet? Coward
497
+ 267024732984053760,2012-11-09 22:03:52 +0000,JConason,RT @HuffingtonPost: CEO who forced workers to attend Romney rally now promises layoffs http://t.co/nZ15MB9x
498
+ 267024732812095488,2012-11-09 22:03:52 +0000,hwain_96,"RT @_Ken_barlow_: Cameron: ""I look forward to working with Obama for the next four years."" 2 years Dave, 2 years."
499
+ 267024731352481792,2012-11-09 22:03:51 +0000,shetrulylovedya,até o obama e a família dançam o gangnam style...
500
+ 267024731193110528,2012-11-09 22:03:51 +0000,r9mcgon,RT @Mike_hugs: Nixon +Kissinger tested the theory that if you bomb a country and risk no U.S. lives the anti-war movement fizzles. Obama proved it correct.
501
+ 267024729980928000,2012-11-09 22:03:51 +0000,skew11,RT @RepJeffDuncan: 102 miners laid off in Utah as a direct result of President Obama's policies. http://t.co/35lZ7Zmv
502
+ 267024729972568065,2012-11-09 22:03:51 +0000,ayyuradita,Congratulation for barack obama [pic] — http://t.co/OJy8DE6T
503
+ 267024729741877249,2012-11-09 22:03:51 +0000,homeoffice_biz,"Hugo Chavez Offers Obama Some Advice: Fresh off his own reelection, Venezuelan President Hugo Chavez has a stron... http://t.co/HD7dUzVg"
504
+ 267024729708298240,2012-11-09 22:03:51 +0000,donthebear,Bone head and Google eys would not answer the POTUS phone call! http://t.co/rra6QAiw
505
+ 267024729527971841,2012-11-09 22:03:51 +0000,Imercuryinfo,"9% Inflation, Obama Care, fewer rights in our socialist future even if Romney had won. http://t.co/0ZAO8Xv6"
506
+ 267024728898801664,2012-11-09 22:03:51 +0000,lege_atque_lacr,Obama holds firm to tax hikes (That is his DNA) http://t.co/TgRk59ir via @foxbusiness
507
+ 267024728403886080,2012-11-09 22:03:50 +0000,vldpopov,"So, selling Obama is similar to selling yoghurts - Secret Data Crunchers Who Helped Obama Win http://t.co/dt5w3xuE via @TIMEPolitics"
508
+ 267024727971856384,2012-11-09 22:03:50 +0000,DanieMilli_anne,then they really wanna argue about it..like what you mad at? Obama is president don't waste your emotion.
509
+ 267024726549999616,2012-11-09 22:03:50 +0000,Says_The_King,I got me an Obama momma. She always be puttin some free money in my account
510
+ 267024726214463488,2012-11-09 22:03:50 +0000,Tatts_N_Dreads,"RT @CNNMoney: Gun sales are up after Obama's reelection, driven by fears of tighter regulation, especially for assault weapons. http://t.co/KEOgWSG9"
511
+ 267024725941817345,2012-11-09 22:03:50 +0000,mensadude,"Ron Paul: Election shows U.S. 'far gone'
512
+ http://t.co/CQoYn2iQ #tcot #teaparty #ronpaul #unemployment #deficit #jobs #gop #USHOUSE #OBAMA"
513
+ 267024725505622016,2012-11-09 22:03:50 +0000,IKrUsHiNsKi,@britney_brinae lol move to Canada if u like Obama sorry this countries not socialist. Ignorance at its finest.
514
+ 267024724817760256,2012-11-09 22:03:50 +0000,mgracer514,@SpeakerBoehner Do NOT give in To Obama John!!! He and Harry Reid KNOW raising taxes on the job creators will not create more tax revenue!!!
515
+ 267024724792590336,2012-11-09 22:03:50 +0000,leenpaape,RT @TheEconomist: Video: Barack Obama looks ahead to four more years and China reveals its next leaders http://t.co/qpho3KlS
516
+ 267024724574474241,2012-11-09 22:03:50 +0000,Timmermanscm,"RT @__Wieke__: Net als in Nederland, toch?! @NOS: Obama: rijken moeten meer belasting betalen http://t.co/gDEN4urK"""
517
+ 267024723769176064,2012-11-09 22:03:49 +0000,ColeMurdock24,People who like the snow also voted for Obama.
518
+ 267024723211333632,2012-11-09 22:03:49 +0000,tbest,Awesome. “@daringfireball: ‘Obama Played OHIO to Win 26-24’: http://t.co/D2eP8EKy”
519
+ 267024723005808640,2012-11-09 22:03:49 +0000,ibtxhis_SaMone,"RT @WeirdFact: President Obama was known to be heavy marijuana smoker in his teen and college days. His nickname used to be ""Barack Oganja""."
520
+ 267024722540244992,2012-11-09 22:03:49 +0000,alejandrita_lm,"RT @VaneEscobarR: Las hijas de Obama conocieron a los Jonas, a Justin y consiguieron primera fila para ver a One Direction ¡OBAMA ADOPTAME!"
521
+ 267024721495879680,2012-11-09 22:03:49 +0000,stewie64,"RT @DanRiehl: How does this work, anyway? Does the media let Obama vet it's questions for everyone?"
522
+ 267024721315504128,2012-11-09 22:03:49 +0000,Evilpa,RT @AACONS: How does Obama's plan to close 1.6M acres of fed land to shale development fit in his plan to create jobs? http://t.co/FOYjcxP6 #tcot #acon
523
+ 267024720321458176,2012-11-09 22:03:49 +0000,DayKadence,RT @Frances_D: Pundit Press: What Luck! Obama Won Dozens of Cleveland Districts... http://t.co/xwWpcpAV
524
+ 267024719470002176,2012-11-09 22:03:48 +0000,Mel_DaOne_,"Nah, that ain't right RT @julieisthatcool: I'll fuck Obama wife"
525
+ 267024719272878080,2012-11-09 22:03:48 +0000,Aslans_Girl,Pundit Press: What Luck! Obama Won Dozens of Cleveland Districts... http://t.co/aCMvGeUr
526
+ 267024719138660352,2012-11-09 22:03:48 +0000,crazyinms,"RT @Clickman8: I’m sure PUTIN, HUGO,CASTRO & AhMADinejad are thrilled over the outcome of the Election! OBAMA fits quite nicely in2 their Circle of Friends"
527
+ 267024717301555200,2012-11-09 22:03:48 +0000,JaeGun_LaoLin,RT @Kennyment: POURQUOI VOUS INVENTEZ DES PAIRINGS COMME ÇA ? LE PIRE QUE J'AI VU DE TOUTE MA VIE C'ÉTAIT OBATAE. OBAMA/TAEMIN.
528
+ 267024717028941824,2012-11-09 22:03:48 +0000,borealizz,RT @utaustinliberal: Jake Tapper demands Carney release a tick-tock of where Pres. Obama was during the Benghazi attack. Shorter Carney: Who the f**k are you?
529
+ 267024716429139968,2012-11-09 22:03:48 +0000,justessheather,"My uncle posted a picture on facebook of seagulls on a shore and said it was ""Obama's supporters waiting for their handouts"" lmfao I can't."
530
+ 267024716362031105,2012-11-09 22:03:48 +0000,maxD_ooUt,“@JennaNanci: My family is fucked because Obama is the president.” Join the club
531
+ 267024716181696512,2012-11-09 22:03:48 +0000,KacyleneS,RT @ArsheanaLaNesha: White gyrls yall fucking black nigghas so stop riding OBAMA DICK DAMN
532
+ 267024714717884416,2012-11-09 22:03:47 +0000,Imercuryinfo,"I uploaded a @YouTube video http://t.co/BgQkRT5u 9% Inflation, Obama Care, fewer rights in our socialist future even if Romney had"
533
+ 267024714566885376,2012-11-09 22:03:47 +0000,MuslimGeezer,Aung San Suu Kyi initially opposed Obama’s Burma trip http://t.co/rntYv65C
534
+ 267024714407493632,2012-11-09 22:03:47 +0000,MDiPasquale1999,"@MarciaCM1 @royparrish of course Obama accepted his resignation because he wrote his ""resignation."""
535
+ 267024713979662336,2012-11-09 22:03:47 +0000,TigerBaby84,"RT @BreitbartNews: Obama: No Deal Without Tax Hikes: The lines are now set for the battle over the fiscal cliff. The fiscal cliff, ... http://t.co/YDHgzwFE"
536
+ 267024713883193344,2012-11-09 22:03:47 +0000,CriticalMassTX,RT @thinkprogress: The 6 best overreactions to Obama’s win. watch Glenn Beck's rant. spooky shit http://t.co/sZfQkkLd via @ARStrasser #icymi
537
+ 267024713161781250,2012-11-09 22:03:47 +0000,cobe001001,"RT @whitehouse: President Obama: ""I’m committed to solving our fiscal challenges. But I refuse to accept any approach that isn’t balanced."""
538
+ 267024713157578752,2012-11-09 22:03:47 +0000,MeganPanatier,City of Obama to invite Obama to Japan - The Tokyo Times http://t.co/1SwafGOM via @TheTokyoTimes
539
+ 267024712977219584,2012-11-09 22:03:47 +0000,Katie_janca,RT @140elect: Hillary Clinton has said for years she wont serve in Obama's second term. Now if/when she resigns #Benghazi conspiracists will go crazy.
540
+ 267024712549400576,2012-11-09 22:03:47 +0000,Linapooh1,Sumbody had to do it!! The Obama Car! http://t.co/NLSrOT4A
541
+ 267024712264212480,2012-11-09 22:03:47 +0000,cinrui,"RT @SeanKCarter: Oliver Stone ""I find Obama scary!"" So do we Mr. Stone, so do we... http://t.co/39YIdQkq #tcot"
542
+ 267024712247435264,2012-11-09 22:03:47 +0000,nthowa2,Obama in a cover up folks! Are we this dumb? CIA Director Petraeus Resigns Over 'Affair' http://t.co/ZKu297Gz via @BreitbartNews
543
+ 267024711932858368,2012-11-09 22:03:47 +0000,dirtyvic_1,@glennbeck @seahannity Commander Fitzpatrick Files Treason Charges Against Barack Obama #teaparty #UT #Election http://t.co/T9GHyUZ4
544
+ 267024711169503232,2012-11-09 22:03:46 +0000,SteveCaruso,Great election background....http://t.co/HwdVs40N
181
545
  eos
182
546
  end
183
547
  end
@@ -185,57 +549,149 @@ ID,Posted at,Screen name,Text
185
549
  before do
186
550
  @search.options = @search.options.merge("long" => true)
187
551
  end
188
- it "should output in long format" do
552
+ it "outputs in long format" do
189
553
  @search.all("twitter")
190
554
  expect($stdout.string).to eq <<-eos
191
555
  ID Posted at Screen name Text
192
- 247827742178021376 Sep 17 14:41 @richrad Bubble Mailer #freebandnames
193
- 247811706061979648 Sep 17 13:38 @dswordsNshields Hair of the Frog (seriou...
194
- 246825473785606145 Sep 14 20:19 @thedunniebobos Wussies and pussies #godd...
195
- 246666260270702592 Sep 14 09:46 @StrongPROGress #FreeBandNames Asterisks ...
196
- 247827742178021376 Sep 17 14:41 @richrad Bubble Mailer #freebandnames
197
- 247811706061979648 Sep 17 13:38 @dswordsNshields Hair of the Frog (seriou...
198
- 246825473785606145 Sep 14 20:19 @thedunniebobos Wussies and pussies #godd...
199
- 246666260270702592 Sep 14 09:46 @StrongPROGress #FreeBandNames Asterisks ...
200
- 247827742178021376 Sep 17 14:41 @richrad Bubble Mailer #freebandnames
201
- 247811706061979648 Sep 17 13:38 @dswordsNshields Hair of the Frog (seriou...
202
- 246825473785606145 Sep 14 20:19 @thedunniebobos Wussies and pussies #godd...
203
- 246666260270702592 Sep 14 09:46 @StrongPROGress #FreeBandNames Asterisks ...
204
- 247827742178021376 Sep 17 14:41 @richrad Bubble Mailer #freebandnames
205
- 247811706061979648 Sep 17 13:38 @dswordsNshields Hair of the Frog (seriou...
206
- 246825473785606145 Sep 14 20:19 @thedunniebobos Wussies and pussies #godd...
207
- 246666260270702592 Sep 14 09:46 @StrongPROGress #FreeBandNames Asterisks ...
208
- 247827742178021376 Sep 17 14:41 @richrad Bubble Mailer #freebandnames
209
- 247811706061979648 Sep 17 13:38 @dswordsNshields Hair of the Frog (seriou...
210
- 246825473785606145 Sep 14 20:19 @thedunniebobos Wussies and pussies #godd...
211
- 246666260270702592 Sep 14 09:46 @StrongPROGress #FreeBandNames Asterisks ...
556
+ 267024754278539266 Nov 9 14:03 @saintsday998 Murray Energy Corp. Obama...
557
+ 267024753326448640 Nov 9 14:03 @thlyons Obama Administration Exte...
558
+ 267024753292869634 Nov 9 14:03 @justmaryse Fox News accidentally ins...
559
+ 267024751854252033 Nov 9 14:03 @BlueTrooth RT @AntiWacko: It's hilar...
560
+ 267024751657115648 Nov 9 14:03 @robbiegleeson RT @Revolution_IRL: RT if...
561
+ 267024751619350528 Nov 9 14:03 @melinwy RT @Kristina_x_x: GOP ent...
562
+ 267024751585808384 Nov 9 14:03 @WANT1DTOFOLLOWU RT @LoveYungCotta: Romney...
563
+ 267024751321575424 Nov 9 14:03 @bodysouls @RealJonLovitz Did u see...
564
+ 267024750109396993 Nov 9 14:03 @tinasebring RT @ken24xavier: YES OBAM...
565
+ 267024749979373568 Nov 9 14:03 @OD_Worrell RT @AP: White House says ...
566
+ 267024749622865921 Nov 9 14:03 @LathamChalaGrp Obama Hangs Tough on the ...
567
+ 267024749501218817 Nov 9 14:03 @sesto09 La lettera di Obama sui g...
568
+ 267024748779819009 Nov 9 14:03 @NickLoveSlayer RT @NewsMCyrus: Después D...
569
+ 267024748536541185 Nov 9 14:03 @Ch_pavon17 RT @PrincipeWilli: -Hoy m...
570
+ 267024746821058560 Nov 9 14:03 @weeki1 RT @jjauthor: #Navy names...
571
+ 267024746724605952 Nov 9 14:03 @LugosLove Wow, Obama Started Crying...
572
+ 267024746389061633 Nov 9 14:03 @jbrons RT @dwiskus: Obama played...
573
+ 267024746372268032 Nov 9 14:03 @Moondances_ RT @_pedropenna: OBAMA te...
574
+ 267024745642463233 Nov 9 14:03 @matthew_austin4 No, I will not shut up. I...
575
+ 267024745546014720 Nov 9 14:03 @FreebirdForever RT @Bobprintdoc: @vickike...
576
+ 267024744673587201 Nov 9 14:03 @_WHOOPdefckindo RT @RiIeyJokess: ME: who ...
577
+ 267024743629209601 Nov 9 14:03 @nikkipjah #Obama's track record wit...
578
+ 267024743323033600 Nov 9 14:03 @pandphomemades RT @JewPublican: Think ab...
579
+ 267024742899412992 Nov 9 14:03 @Vita__Nova Bunda rus-israil ittifakı...
580
+ 267024742295416832 Nov 9 14:03 @tv6tnt White House says Obama wi...
581
+ 267024742257680386 Nov 9 14:03 @ricardo126234 @Jacquie0415 @gregwhoward...
582
+ 267024741381074944 Nov 9 14:03 @LifesaBishh RT @SomeoneBelow: The per...
583
+ 267024740810637313 Nov 9 14:03 @I_Fuk_Wid_OBAMA :) #Pixect http://t.co/jZ...
584
+ 267024740760289280 Nov 9 14:03 @llParadisell Why Libya Cover-Up: Obama...
585
+ 267024739627839488 Nov 9 14:03 @naiburnwoood RT @StephenAtHome: I stil...
586
+ 267024738927394816 Nov 9 14:03 @Neo_Sweetness RT @5oodaysofautumn: #Oba...
587
+ 267024738906431490 Nov 9 14:03 @vcAraceli RT @jusxy: Obama what's m...
588
+ 267024738575065089 Nov 9 14:03 @notsoslimshadys RT @harrynstuff: I bet on...
589
+ 267024738478600192 Nov 9 14:03 @ThinksLogical RT @dlb703: The differenc...
590
+ 267024737937547264 Nov 9 14:03 @pabloirossi Obama, ante el precipicio...
591
+ 267024737794945024 Nov 9 14:03 @mermaid6590 @LeslieMHooper I think Ob...
592
+ 267024737706840064 Nov 9 14:03 @n_mariee3 RT @SAMhOes: Lmao #Obama ...
593
+ 267024737354534912 Nov 9 14:03 @soso2583 RT @20Minutes: Pour Obama...
594
+ 267024736968667136 Nov 9 14:03 @desertkev @k_m_allan I'm more about...
595
+ 267024736373063680 Nov 9 14:03 @blakecallaway yo why did obama have to win
596
+ 267024736108818432 Nov 9 14:03 @AlondraMiaa RT @FaithOn1D: "Las hijas...
597
+ 267024735878119424 Nov 9 14:03 @4iHD Szef CIA zrezygnował prze...
598
+ 267024735450324993 Nov 9 14:03 @fcukjessi RT @JosieNelson7: Obama y...
599
+ 267024735156703232 Nov 9 14:03 @Evilazio Obama "decepciona" mercad...
600
+ 267024734628233218 Nov 9 14:03 @carolynedgar @GoAngelo let's just spec...
601
+ 267024734481440769 Nov 9 14:03 @bob_mor RT @NoticiasCaracol: Obam...
602
+ 267024734464651264 Nov 9 14:03 @NotBarack FEMA Failed/Obama Hailed ...
603
+ 267024733319598080 Nov 9 14:03 @georgiaokeeffex Obama
604
+ 267024733189582849 Nov 9 14:03 @LLW83 RT @TheDailyEdge: Obama h...
605
+ 267024733067943936 Nov 9 14:03 @aylin_arellanoo RT @lupiss14: - Ya viste ...
606
+ 267024732984053761 Nov 9 14:03 @ASyrupp @realDonaldTrump hey idio...
607
+ 267024732984053760 Nov 9 14:03 @JConason RT @HuffingtonPost: CEO w...
608
+ 267024732812095488 Nov 9 14:03 @hwain_96 RT @_Ken_barlow_: Cameron...
609
+ 267024731352481792 Nov 9 14:03 @shetrulylovedya até o obama e a família d...
610
+ 267024731193110528 Nov 9 14:03 @r9mcgon RT @Mike_hugs: Nixon +Kis...
611
+ 267024729980928000 Nov 9 14:03 @skew11 RT @RepJeffDuncan: 102 mi...
612
+ 267024729972568065 Nov 9 14:03 @ayyuradita Congratulation for barack...
613
+ 267024729741877249 Nov 9 14:03 @homeoffice_biz Hugo Chavez Offers Obama ...
614
+ 267024729708298240 Nov 9 14:03 @donthebear Bone head and Google eys ...
615
+ 267024729527971841 Nov 9 14:03 @Imercuryinfo 9% Inflation, Obama Care,...
616
+ 267024728898801664 Nov 9 14:03 @lege_atque_lacr Obama holds firm to tax h...
617
+ 267024728403886080 Nov 9 14:03 @vldpopov So, selling Obama is sim...
618
+ 267024727971856384 Nov 9 14:03 @DanieMilli_anne then they really wanna ar...
619
+ 267024726549999616 Nov 9 14:03 @Says_The_King I got me an Obama momma. ...
620
+ 267024726214463488 Nov 9 14:03 @Tatts_N_Dreads RT @CNNMoney: Gun sales a...
621
+ 267024725941817345 Nov 9 14:03 @mensadude Ron Paul: Election shows ...
622
+ 267024725505622016 Nov 9 14:03 @IKrUsHiNsKi @britney_brinae lol move ...
623
+ 267024724817760256 Nov 9 14:03 @mgracer514 @SpeakerBoehner Do NOT gi...
624
+ 267024724792590336 Nov 9 14:03 @leenpaape RT @TheEconomist: Video: ...
625
+ 267024724574474241 Nov 9 14:03 @Timmermanscm RT @__Wieke__: Net als in...
626
+ 267024723769176064 Nov 9 14:03 @ColeMurdock24 People who like the snow ...
627
+ 267024723211333632 Nov 9 14:03 @tbest Awesome. “@daringfireball...
628
+ 267024723005808640 Nov 9 14:03 @ibtxhis_SaMone RT @WeirdFact: President ...
629
+ 267024722540244992 Nov 9 14:03 @alejandrita_lm RT @VaneEscobarR: Las hij...
630
+ 267024721495879680 Nov 9 14:03 @stewie64 RT @DanRiehl: How does th...
631
+ 267024721315504128 Nov 9 14:03 @Evilpa RT @AACONS: How does Obam...
632
+ 267024720321458176 Nov 9 14:03 @DayKadence RT @Frances_D: Pundit Pre...
633
+ 267024719470002176 Nov 9 14:03 @Mel_DaOne_ Nah, that ain't right RT ...
634
+ 267024719272878080 Nov 9 14:03 @Aslans_Girl Pundit Press: What Luck! ...
635
+ 267024719138660352 Nov 9 14:03 @crazyinms RT @Clickman8: I’m sure P...
636
+ 267024717301555200 Nov 9 14:03 @JaeGun_LaoLin RT @Kennyment: POURQUOI V...
637
+ 267024717028941824 Nov 9 14:03 @borealizz RT @utaustinliberal: Jake...
638
+ 267024716429139968 Nov 9 14:03 @justessheather My uncle posted a picture...
639
+ 267024716362031105 Nov 9 14:03 @maxD_ooUt “@JennaNanci: My family i...
640
+ 267024716181696512 Nov 9 14:03 @KacyleneS RT @ArsheanaLaNesha: Whit...
641
+ 267024714717884416 Nov 9 14:03 @Imercuryinfo I uploaded a @YouTube vid...
642
+ 267024714566885376 Nov 9 14:03 @MuslimGeezer Aung San Suu Kyi initiall...
643
+ 267024714407493632 Nov 9 14:03 @MDiPasquale1999 @MarciaCM1 @royparrish of...
644
+ 267024713979662336 Nov 9 14:03 @TigerBaby84 RT @BreitbartNews: Obama:...
645
+ 267024713883193344 Nov 9 14:03 @CriticalMassTX RT @thinkprogress: The 6 ...
646
+ 267024713161781250 Nov 9 14:03 @cobe001001 RT @whitehouse: President...
647
+ 267024713157578752 Nov 9 14:03 @MeganPanatier City of Obama to invite O...
648
+ 267024712977219584 Nov 9 14:03 @Katie_janca RT @140elect: Hillary Cli...
649
+ 267024712549400576 Nov 9 14:03 @Linapooh1 Sumbody had to do it!! Th...
650
+ 267024712264212480 Nov 9 14:03 @cinrui RT @SeanKCarter: Oliver S...
651
+ 267024712247435264 Nov 9 14:03 @nthowa2 Obama in a cover up folks...
652
+ 267024711932858368 Nov 9 14:03 @dirtyvic_1 @glennbeck @seahannity Co...
653
+ 267024711169503232 Nov 9 14:03 @SteveCaruso Great election background...
212
654
  eos
213
655
  end
214
656
  end
215
657
  context "--number" do
216
658
  before do
217
- stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :rpp => "1"}).to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
218
- stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :rpp => "200"}).to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
219
- stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :rpp => "200", :max_id => "246666260270702591"}).to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
220
- (1..197).step(4).to_a.each do |count|
221
- stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :rpp => count, :max_id => "246666260270702591"}).to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
222
- end
659
+ stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :count => "1"}).to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
660
+ stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :count => "200"}).to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
661
+ stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :count => "103", :max_id => "267024711169503231"}).to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
662
+ stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :count => "5", :max_id => "267024711169503231"}).to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
223
663
  end
224
- it "should limit the number of results to 1" do
664
+ it "limits the number of results to 1" do
225
665
  @search.options = @search.options.merge("number" => 1)
666
+ results = @search.all("twitter")
667
+ expect(a_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :count => "1"})).to have_been_made
668
+ end
669
+ it "limits the number of results to 201" do
670
+ @search.options = @search.options.merge("number" => 201)
671
+ @search.all("twitter")
672
+ expect(a_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :count => "200"})).to have_been_made
673
+ expect(a_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :count => "103", :max_id => "267024711169503231"})).to have_been_made
674
+ expect(a_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :count => "5", :max_id => "267024711169503231"})).to have_been_made
675
+ end
676
+ end
677
+ context "--decode_urls" do
678
+ before(:each) do
679
+ stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :count => 20}).to_return(:body => fixture("search_with_entities.json"), :headers => {:content_type => "application/json; charset=utf-8"})
680
+ stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :count => 5, :max_id => 264784855672442882}).to_return(:body => fixture("search_with_entities.json"), :headers => {:content_type => "application/json; charset=utf-8"})
681
+ stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :include_entities => 1, :count => 20}).to_return(:body => fixture("search_with_entities.json"), :headers => {:content_type => "application/json; charset=utf-8"})
682
+ stub_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :include_entities => 1, :count => 5, :max_id => 264784855672442882}).to_return(:body => fixture("search_with_entities.json"), :headers => {:content_type => "application/json; charset=utf-8"})
683
+ end
684
+ it "does not decode urls without given the explicit option" do
226
685
  @search.all("twitter")
227
- expect(a_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :rpp => "1"})).to have_been_made
686
+ expect($stdout.string).to include "http://t.co/fwZfnEaA"
228
687
  end
229
- it "should limit the number of results to 345" do
230
- @search.options = @search.options.merge("number" => 345)
688
+ it "decodes the urls correctly" do
689
+ @search.options = @search.options.merge("decode_urls" => true)
231
690
  @search.all("twitter")
232
- expect(a_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :rpp => "200"})).to have_been_made
233
- expect(a_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :rpp => "200", :max_id => "246666260270702591"})).to have_been_made.times(36)
234
- (1..197).step(4).to_a.each do |count|
235
- expect(a_get("/1.1/search/tweets.json").with(:query => {:q => "twitter", :rpp => count, :max_id => "246666260270702591"})).to have_been_made
236
- end
691
+ expect($stdout.string).to include "http://semver.org"
237
692
  end
238
693
  end
694
+
239
695
  end
240
696
 
241
697
  describe "#favorites" do
@@ -243,12 +699,12 @@ ID Posted at Screen name Text
243
699
  stub_get("/1.1/favorites/list.json").with(:query => {:count => "200"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
244
700
  stub_get("/1.1/favorites/list.json").with(:query => {:count => "200", :max_id => "244099460672679937"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
245
701
  end
246
- it "should request the correct resource" do
702
+ it "requests the correct resource" do
247
703
  @search.favorites("twitter")
248
704
  expect(a_get("/1.1/favorites/list.json").with(:query => {:count => "200"})).to have_been_made
249
705
  expect(a_get("/1.1/favorites/list.json").with(:query => {:count => "200", :max_id => "244099460672679937"})).to have_been_made
250
706
  end
251
- it "should have the correct output" do
707
+ it "has the correct output" do
252
708
  @search.favorites("twitter")
253
709
  expect($stdout.string).to eq <<-eos
254
710
  \e[1m\e[33m @sferik\e[0m
@@ -264,7 +720,7 @@ ID Posted at Screen name Text
264
720
  before do
265
721
  @search.options = @search.options.merge("csv" => true)
266
722
  end
267
- it "should output in CSV format" do
723
+ it "outputs in CSV format" do
268
724
  @search.favorites("twitter")
269
725
  expect($stdout.string).to eq <<-eos
270
726
  ID,Posted at,Screen name,Text
@@ -277,7 +733,7 @@ ID,Posted at,Screen name,Text
277
733
  before do
278
734
  @search.options = @search.options.merge("long" => true)
279
735
  end
280
- it "should output in long format" do
736
+ it "outputs in long format" do
281
737
  @search.favorites("twitter")
282
738
  expect($stdout.string).to eq <<-eos
283
739
  ID Posted at Screen name Text
@@ -286,8 +742,23 @@ ID Posted at Screen name Text
286
742
  eos
287
743
  end
288
744
  end
745
+ context "--decode_urls" do
746
+ before(:each) do
747
+ stub_get("/1.1/favorites/list.json").with(:query => {:count => "200", :include_entities => 1}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
748
+ stub_get("/1.1/favorites/list.json").with(:query => {:count => "200", :include_entities => 1, :max_id => "244099460672679937"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
749
+ end
750
+ it "does not decode urls without given the explicit option" do
751
+ @search.favorites("twitter")
752
+ expect($stdout.string).to include "https://t.co/I17jUTu2"
753
+ end
754
+ it "decodes the urls correctly" do
755
+ @search.options = @search.options.merge("decode_urls" => true)
756
+ @search.favorites("twitter")
757
+ expect($stdout.string).to include "https://twitter.com/sferik/status/243988000076337152"
758
+ end
759
+ end
289
760
  context "Twitter is down" do
290
- it "should retry 3 times and then raise an error" do
761
+ it "retries 3 times and then raise an error" do
291
762
  stub_get("/1.1/favorites/list.json").with(:query => {:count => "200"}).to_return(:status => 502)
292
763
  expect do
293
764
  @search.favorites("twitter")
@@ -300,12 +771,12 @@ ID Posted at Screen name Text
300
771
  stub_get("/1.1/favorites/list.json").with(:query => {:count => "200", :screen_name => "sferik"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
301
772
  stub_get("/1.1/favorites/list.json").with(:query => {:count => "200", :max_id => "244099460672679937", :screen_name => "sferik"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
302
773
  end
303
- it "should request the correct resource" do
774
+ it "requests the correct resource" do
304
775
  @search.favorites("sferik", "twitter")
305
776
  expect(a_get("/1.1/favorites/list.json").with(:query => {:count => "200", :screen_name => "sferik"})).to have_been_made
306
777
  expect(a_get("/1.1/favorites/list.json").with(:query => {:count => "200", :max_id => "244099460672679937", :screen_name => "sferik"})).to have_been_made
307
778
  end
308
- it "should have the correct output" do
779
+ it "has the correct output" do
309
780
  @search.favorites("sferik", "twitter")
310
781
  expect($stdout.string).to eq <<-eos
311
782
  \e[1m\e[33m @sferik\e[0m
@@ -317,6 +788,30 @@ ID Posted at Screen name Text
317
788
 
318
789
  eos
319
790
  end
791
+ context "--id" do
792
+ before do
793
+ @search.options = @search.options.merge("id" => true)
794
+ stub_get("/1.1/favorites/list.json").with(:query => {:count => "200", :user_id => "7505382"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
795
+ stub_get("/1.1/favorites/list.json").with(:query => {:count => "200", :max_id => "244099460672679937", :user_id => "7505382"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
796
+ end
797
+ it "requests the correct resource" do
798
+ @search.favorites("7505382", "twitter")
799
+ expect(a_get("/1.1/favorites/list.json").with(:query => {:count => "200", :user_id => "7505382"})).to have_been_made
800
+ expect(a_get("/1.1/favorites/list.json").with(:query => {:count => "200", :max_id => "244099460672679937", :user_id => "7505382"})).to have_been_made
801
+ end
802
+ it "has the correct output" do
803
+ @search.favorites("7505382", "twitter")
804
+ expect($stdout.string).to eq <<-eos
805
+ \e[1m\e[33m @sferik\e[0m
806
+ @episod @twitterapi now https://t.co/I17jUTu2 and https://t.co/deDu4Hgw seem
807
+ to be missing "1.1" from the URL.
808
+
809
+ \e[1m\e[33m @sferik\e[0m
810
+ @episod @twitterapi Did you catch https://t.co/VHsQvZT0 as well?
811
+
812
+ eos
813
+ end
814
+ end
320
815
  end
321
816
  end
322
817
 
@@ -325,12 +820,12 @@ ID Posted at Screen name Text
325
820
  stub_get("/1.1/statuses/mentions_timeline.json").with(:query => {:count => "200"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
326
821
  stub_get("/1.1/statuses/mentions_timeline.json").with(:query => {:count => "200", :max_id => "244099460672679937"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
327
822
  end
328
- it "should request the correct resource" do
823
+ it "requests the correct resource" do
329
824
  @search.mentions("twitter")
330
825
  expect(a_get("/1.1/statuses/mentions_timeline.json").with(:query => {:count => "200"})).to have_been_made
331
826
  expect(a_get("/1.1/statuses/mentions_timeline.json").with(:query => {:count => "200", :max_id => "244099460672679937"})).to have_been_made
332
827
  end
333
- it "should have the correct output" do
828
+ it "has the correct output" do
334
829
  @search.mentions("twitter")
335
830
  expect($stdout.string).to eq <<-eos
336
831
  \e[1m\e[33m @sferik\e[0m
@@ -346,7 +841,7 @@ ID Posted at Screen name Text
346
841
  before do
347
842
  @search.options = @search.options.merge("csv" => true)
348
843
  end
349
- it "should output in CSV format" do
844
+ it "outputs in CSV format" do
350
845
  @search.mentions("twitter")
351
846
  expect($stdout.string).to eq <<-eos
352
847
  ID,Posted at,Screen name,Text
@@ -359,7 +854,7 @@ ID,Posted at,Screen name,Text
359
854
  before do
360
855
  @search.options = @search.options.merge("long" => true)
361
856
  end
362
- it "should output in long format" do
857
+ it "outputs in long format" do
363
858
  @search.mentions("twitter")
364
859
  expect($stdout.string).to eq <<-eos
365
860
  ID Posted at Screen name Text
@@ -368,8 +863,23 @@ ID Posted at Screen name Text
368
863
  eos
369
864
  end
370
865
  end
866
+ context "--decode_urls" do
867
+ before(:each) do
868
+ stub_get("/1.1/statuses/mentions_timeline.json").with(:query => {:count => "200", :include_entities => 1}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
869
+ stub_get("/1.1/statuses/mentions_timeline.json").with(:query => {:count => "200", :include_entities => 1, :max_id => "244099460672679937"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
870
+ end
871
+ it "does not decode urls without given the explicit option" do
872
+ @search.mentions("twitter")
873
+ expect($stdout.string).to include "https://t.co/I17jUTu2"
874
+ end
875
+ it "decodes the urls correctly" do
876
+ @search.options = @search.options.merge("decode_urls" => true)
877
+ @search.mentions("twitter")
878
+ expect($stdout.string).to include "https://twitter.com/sferik/status/243988000076337152"
879
+ end
880
+ end
371
881
  context "Twitter is down" do
372
- it "should retry 3 times and then raise an error" do
882
+ it "retries 3 times and then raise an error" do
373
883
  stub_get("/1.1/statuses/mentions_timeline.json").with(:query => {:count => "200"}).to_return(:status => 502)
374
884
  expect do
375
885
  @search.mentions("twitter")
@@ -384,12 +894,12 @@ ID Posted at Screen name Text
384
894
  stub_get("/1.1/lists/statuses.json").with(:query => {:count => "200", :owner_screen_name => "testcli", :slug => "presidents"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
385
895
  stub_get("/1.1/lists/statuses.json").with(:query => {:count => "200", :max_id => "244099460672679937", :owner_screen_name => "testcli", :slug => "presidents"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
386
896
  end
387
- it "should request the correct resource" do
897
+ it "requests the correct resource" do
388
898
  @search.list("presidents", "twitter")
389
899
  expect(a_get("/1.1/lists/statuses.json").with(:query => {:count => "200", :owner_screen_name => "testcli", :slug => "presidents"})).to have_been_made
390
900
  expect(a_get("/1.1/lists/statuses.json").with(:query => {:count => "200", :max_id => "244099460672679937", :owner_screen_name => "testcli", :slug => "presidents"})).to have_been_made
391
901
  end
392
- it "should have the correct output" do
902
+ it "has the correct output" do
393
903
  @search.list("presidents", "twitter")
394
904
  expect($stdout.string).to eq <<-eos
395
905
  \e[1m\e[33m @sferik\e[0m
@@ -405,7 +915,7 @@ ID Posted at Screen name Text
405
915
  before do
406
916
  @search.options = @search.options.merge("csv" => true)
407
917
  end
408
- it "should output in CSV format" do
918
+ it "outputs in CSV format" do
409
919
  @search.list("presidents", "twitter")
410
920
  expect($stdout.string).to eq <<-eos
411
921
  ID,Posted at,Screen name,Text
@@ -418,7 +928,7 @@ ID,Posted at,Screen name,Text
418
928
  before do
419
929
  @search.options = @search.options.merge("long" => true)
420
930
  end
421
- it "should output in long format" do
931
+ it "outputs in long format" do
422
932
  @search.list("presidents", "twitter")
423
933
  expect($stdout.string).to eq <<-eos
424
934
  ID Posted at Screen name Text
@@ -427,8 +937,23 @@ ID Posted at Screen name Text
427
937
  eos
428
938
  end
429
939
  end
940
+ context "--decode_urls" do
941
+ before(:each) do
942
+ stub_get("/1.1/lists/statuses.json").with(:query => {:count => "200", :include_entities => 1, :owner_screen_name => "testcli", :slug => "presidents"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
943
+ stub_get("/1.1/lists/statuses.json").with(:query => {:count => "200", :include_entities => 1, :max_id => "244099460672679937", :owner_screen_name => "testcli", :slug => "presidents"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
944
+ end
945
+ it "does not decode urls without given the explicit option" do
946
+ @search.list("presidents", "twitter")
947
+ expect($stdout.string).to include "https://t.co/I17jUTu2"
948
+ end
949
+ it "decodes the urls correctly" do
950
+ @search.options = @search.options.merge("decode_urls" => true)
951
+ @search.list("presidents", "twitter")
952
+ expect($stdout.string).to include "https://dev.twitter.com/docs/api/post/direct_messages/destroy"
953
+ end
954
+ end
430
955
  context "with a user passed" do
431
- it "should request the correct resource" do
956
+ it "requests the correct resource" do
432
957
  @search.list("testcli/presidents", "twitter")
433
958
  expect(a_get("/1.1/lists/statuses.json").with(:query => {:count => "200", :owner_screen_name => "testcli", :slug => "presidents"})).to have_been_made
434
959
  end
@@ -438,7 +963,7 @@ ID Posted at Screen name Text
438
963
  stub_get("/1.1/lists/statuses.json").with(:query => {:count => "200", :owner_id => "7505382", :slug => "presidents"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
439
964
  stub_get("/1.1/lists/statuses.json").with(:query => {:count => "200", :max_id => "244099460672679937", :owner_id => "7505382", :slug => "presidents"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
440
965
  end
441
- it "should request the correct resource" do
966
+ it "requests the correct resource" do
442
967
  @search.list("7505382/presidents", "twitter")
443
968
  expect(a_get("/1.1/lists/statuses.json").with(:query => {:count => "200", :owner_id => "7505382", :slug => "presidents"})).to have_been_made
444
969
  expect(a_get("/1.1/lists/statuses.json").with(:query => {:count => "200", :max_id => "244099460672679937", :owner_id => "7505382", :slug => "presidents"})).to have_been_made
@@ -446,7 +971,7 @@ ID Posted at Screen name Text
446
971
  end
447
972
  end
448
973
  context "Twitter is down" do
449
- it "should retry 3 times and then raise an error" do
974
+ it "retries 3 times and then raise an error" do
450
975
  stub_get("/1.1/lists/statuses.json").with(:query => {:count => "200", :owner_screen_name => "testcli", :slug => "presidents"}).to_return(:status => 502)
451
976
  expect do
452
977
  @search.list("presidents", "twitter")
@@ -461,12 +986,12 @@ ID Posted at Screen name Text
461
986
  stub_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :include_rts => "true"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
462
987
  stub_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :include_rts => "true", :max_id => "244102729860009983"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
463
988
  end
464
- it "should request the correct resource" do
989
+ it "requests the correct resource" do
465
990
  @search.retweets("mosaic")
466
991
  expect(a_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :include_rts => "true"})).to have_been_made
467
992
  expect(a_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :include_rts => "true", :max_id => "244102729860009983"})).to have_been_made.times(2)
468
993
  end
469
- it "should have the correct output" do
994
+ it "has the correct output" do
470
995
  @search.retweets("mosaic")
471
996
  expect($stdout.string).to eq <<-eos
472
997
  \e[1m\e[33m @calebelston\e[0m
@@ -478,7 +1003,7 @@ ID Posted at Screen name Text
478
1003
  before do
479
1004
  @search.options = @search.options.merge("csv" => true)
480
1005
  end
481
- it "should output in CSV format" do
1006
+ it "outputs in CSV format" do
482
1007
  @search.retweets("mosaic")
483
1008
  expect($stdout.string).to eq <<-eos
484
1009
  ID,Posted at,Screen name,Text
@@ -490,7 +1015,7 @@ ID,Posted at,Screen name,Text
490
1015
  before do
491
1016
  @search.options = @search.options.merge("long" => true)
492
1017
  end
493
- it "should output in long format" do
1018
+ it "outputs in long format" do
494
1019
  @search.retweets("mosaic")
495
1020
  expect($stdout.string).to eq <<-eos
496
1021
  ID Posted at Screen name Text
@@ -498,8 +1023,23 @@ ID Posted at Screen name Text
498
1023
  eos
499
1024
  end
500
1025
  end
1026
+ context "--decode_urls" do
1027
+ before(:each) do
1028
+ stub_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :include_entities => 1, :include_rts => "true"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
1029
+ stub_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :include_entities => 1, :include_rts => "true", :max_id => "244102729860009983"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
1030
+ end
1031
+ it "does not decode urls without given the explicit option" do
1032
+ @search.retweets("mosaic")
1033
+ expect($stdout.string).to include "http://t.co/A8013C9k"
1034
+ end
1035
+ it "decodes the urls correctly" do
1036
+ @search.options = @search.options.merge("decode_urls" => true)
1037
+ @search.retweets("mosaic")
1038
+ expect($stdout.string).to include "http://heymosaic.com/i/1Z8ssK"
1039
+ end
1040
+ end
501
1041
  context "Twitter is down" do
502
- it "should retry 3 times and then raise an error" do
1042
+ it "retries 3 times and then raise an error" do
503
1043
  stub_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :include_rts => "true"}).to_return(:status => 502)
504
1044
  expect do
505
1045
  @search.retweets("mosaic")
@@ -512,12 +1052,12 @@ ID Posted at Screen name Text
512
1052
  stub_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :include_rts => "true", :screen_name => "sferik"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
513
1053
  stub_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :include_rts => "true", :screen_name => "sferik", :max_id => "244102729860009983"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
514
1054
  end
515
- it "should request the correct resource" do
1055
+ it "requests the correct resource" do
516
1056
  @search.retweets("sferik", "mosaic")
517
1057
  expect(a_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :include_rts => "true", :screen_name => "sferik"})).to have_been_made
518
1058
  expect(a_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :include_rts => "true", :screen_name => "sferik", :max_id => "244102729860009983"})).to have_been_made.times(2)
519
1059
  end
520
- it "should have the correct output" do
1060
+ it "has the correct output" do
521
1061
  @search.retweets("sferik", "mosaic")
522
1062
  expect($stdout.string).to eq <<-eos
523
1063
  \e[1m\e[33m @calebelston\e[0m
@@ -525,6 +1065,26 @@ ID Posted at Screen name Text
525
1065
 
526
1066
  eos
527
1067
  end
1068
+ context "--id" do
1069
+ before do
1070
+ @search.options = @search.options.merge("id" => true)
1071
+ stub_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :include_rts => "true", :user_id => "7505382"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
1072
+ stub_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :include_rts => "true", :user_id => "7505382", :max_id => "244102729860009983"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
1073
+ end
1074
+ it "requests the correct resource" do
1075
+ @search.retweets("7505382", "mosaic")
1076
+ expect(a_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :include_rts => "true", :user_id => "7505382"})).to have_been_made
1077
+ expect(a_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :include_rts => "true", :user_id => "7505382", :max_id => "244102729860009983"})).to have_been_made.times(2)
1078
+ end
1079
+ it "has the correct output" do
1080
+ @search.retweets("7505382", "mosaic")
1081
+ expect($stdout.string).to eq <<-eos
1082
+ \e[1m\e[33m @calebelston\e[0m
1083
+ RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
1084
+
1085
+ eos
1086
+ end
1087
+ end
528
1088
  end
529
1089
  end
530
1090
 
@@ -533,12 +1093,12 @@ ID Posted at Screen name Text
533
1093
  stub_get("/1.1/statuses/home_timeline.json").with(:query => {:count => "200"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
534
1094
  stub_get("/1.1/statuses/home_timeline.json").with(:query => {:count => "200", :max_id => "244099460672679937"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
535
1095
  end
536
- it "should request the correct resource" do
1096
+ it "requests the correct resource" do
537
1097
  @search.timeline("twitter")
538
1098
  expect(a_get("/1.1/statuses/home_timeline.json").with(:query => {:count => "200"})).to have_been_made
539
1099
  expect(a_get("/1.1/statuses/home_timeline.json").with(:query => {:count => "200", :max_id => "244099460672679937"})).to have_been_made
540
1100
  end
541
- it "should have the correct output" do
1101
+ it "has the correct output" do
542
1102
  @search.timeline("twitter")
543
1103
  expect($stdout.string).to eq <<-eos
544
1104
  \e[1m\e[33m @sferik\e[0m
@@ -554,7 +1114,7 @@ ID Posted at Screen name Text
554
1114
  before do
555
1115
  @search.options = @search.options.merge("csv" => true)
556
1116
  end
557
- it "should output in CSV format" do
1117
+ it "outputs in CSV format" do
558
1118
  @search.timeline("twitter")
559
1119
  expect($stdout.string).to eq <<-eos
560
1120
  ID,Posted at,Screen name,Text
@@ -563,11 +1123,35 @@ ID,Posted at,Screen name,Text
563
1123
  eos
564
1124
  end
565
1125
  end
1126
+ context "--exclude=replies" do
1127
+ before do
1128
+ @search.options = @search.options.merge("exclude" => "replies")
1129
+ stub_get("/1.1/statuses/home_timeline.json").with(:query => {:count => "200", :exclude_replies => "true"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
1130
+ stub_get("/1.1/statuses/home_timeline.json").with(:query => {:count => "200", :exclude_replies => "true", :max_id => "244099460672679937"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
1131
+ end
1132
+ it "excludes replies" do
1133
+ @search.timeline
1134
+ expect(a_get("/1.1/statuses/home_timeline.json").with(:query => {:count => "200", :exclude_replies => "true"})).to have_been_made
1135
+ expect(a_get("/1.1/statuses/home_timeline.json").with(:query => {:count => "200", :exclude_replies => "true", :max_id => "244099460672679937"})).to have_been_made
1136
+ end
1137
+ end
1138
+ context "--exclude=retweets" do
1139
+ before do
1140
+ @search.options = @search.options.merge("exclude" => "retweets")
1141
+ stub_get("/1.1/statuses/home_timeline.json").with(:query => {:count => "200", :include_rts => "false"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
1142
+ stub_get("/1.1/statuses/home_timeline.json").with(:query => {:count => "200", :include_rts => "false", :max_id => "244099460672679937"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
1143
+ end
1144
+ it "excludes retweets" do
1145
+ @search.timeline
1146
+ expect(a_get("/1.1/statuses/home_timeline.json").with(:query => {:count => "200", :include_rts => "false"})).to have_been_made
1147
+ expect(a_get("/1.1/statuses/home_timeline.json").with(:query => {:count => "200", :include_rts => "false", :max_id => "244099460672679937"})).to have_been_made
1148
+ end
1149
+ end
566
1150
  context "--long" do
567
1151
  before do
568
1152
  @search.options = @search.options.merge("long" => true)
569
1153
  end
570
- it "should output in long format" do
1154
+ it "outputs in long format" do
571
1155
  @search.timeline("twitter")
572
1156
  expect($stdout.string).to eq <<-eos
573
1157
  ID Posted at Screen name Text
@@ -576,8 +1160,23 @@ ID Posted at Screen name Text
576
1160
  eos
577
1161
  end
578
1162
  end
1163
+ context "--decode_urls" do
1164
+ before(:each) do
1165
+ stub_get("/1.1/statuses/home_timeline.json").with(:query => {:count => "200", :include_entities => 1}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
1166
+ stub_get("/1.1/statuses/home_timeline.json").with(:query => {:count => "200", :max_id => "244099460672679937", :include_entities => 1}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
1167
+ end
1168
+ it "does not decode urls without given the explicit option" do
1169
+ @search.timeline("twitter")
1170
+ expect($stdout.string).to include "https://t.co/I17jUTu2"
1171
+ end
1172
+ it "decodes the urls correctly" do
1173
+ @search.options = @search.options.merge("decode_urls" => true)
1174
+ @search.timeline("twitter")
1175
+ expect($stdout.string).to include "https://dev.twitter.com/docs/api/post/direct_messages/destroy"
1176
+ end
1177
+ end
579
1178
  context "Twitter is down" do
580
- it "should retry 3 times and then raise an error" do
1179
+ it "retries 3 times and then raise an error" do
581
1180
  stub_get("/1.1/statuses/home_timeline.json").with(:query => {:count => "200"}).to_return(:status => 502)
582
1181
  expect do
583
1182
  @search.timeline("twitter")
@@ -590,12 +1189,12 @@ ID Posted at Screen name Text
590
1189
  stub_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :screen_name => "sferik"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
591
1190
  stub_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :max_id => "244099460672679937", :screen_name => "sferik"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
592
1191
  end
593
- it "should request the correct resource" do
1192
+ it "requests the correct resource" do
594
1193
  @search.timeline("sferik", "twitter")
595
1194
  expect(a_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :screen_name => "sferik"})).to have_been_made
596
1195
  expect(a_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :max_id => "244099460672679937", :screen_name => "sferik"})).to have_been_made
597
1196
  end
598
- it "should have the correct output" do
1197
+ it "has the correct output" do
599
1198
  @search.timeline("sferik", "twitter")
600
1199
  expect($stdout.string).to eq <<-eos
601
1200
  \e[1m\e[33m @sferik\e[0m
@@ -611,7 +1210,7 @@ ID Posted at Screen name Text
611
1210
  before do
612
1211
  @search.options = @search.options.merge("csv" => true)
613
1212
  end
614
- it "should output in CSV format" do
1213
+ it "outputs in CSV format" do
615
1214
  @search.timeline("sferik", "twitter")
616
1215
  expect($stdout.string).to eq <<-eos
617
1216
  ID,Posted at,Screen name,Text
@@ -626,7 +1225,7 @@ ID,Posted at,Screen name,Text
626
1225
  stub_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :user_id => "7505382"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
627
1226
  stub_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :max_id => "244099460672679937", :user_id => "7505382"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
628
1227
  end
629
- it "should request the correct resource" do
1228
+ it "requests the correct resource" do
630
1229
  @search.timeline("7505382", "twitter")
631
1230
  expect(a_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :user_id => "7505382"})).to have_been_made
632
1231
  expect(a_get("/1.1/statuses/user_timeline.json").with(:query => {:count => "200", :max_id => "244099460672679937", :user_id => "7505382"})).to have_been_made
@@ -636,7 +1235,7 @@ ID,Posted at,Screen name,Text
636
1235
  before do
637
1236
  @search.options = @search.options.merge("long" => true)
638
1237
  end
639
- it "should output in long format" do
1238
+ it "outputs in long format" do
640
1239
  @search.timeline("sferik", "twitter")
641
1240
  expect($stdout.string).to eq <<-eos
642
1241
  ID Posted at Screen name Text
@@ -646,7 +1245,7 @@ ID Posted at Screen name Text
646
1245
  end
647
1246
  end
648
1247
  context "Twitter is down" do
649
- it "should retry 3 times and then raise an error" do
1248
+ it "retries 3 times and then raise an error" do
650
1249
  stub_get("/1.1/statuses/user_timeline.json").with(:query => {:screen_name => "sferik", :count => "200"}).to_return(:status => 502)
651
1250
  expect do
652
1251
  @search.timeline("sferik", "twitter")
@@ -662,14 +1261,14 @@ ID Posted at Screen name Text
662
1261
  stub_get("/1.1/users/search.json").with(:query => {:page => "1", :q => "Erik"}).to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
663
1262
  stub_get("/1.1/users/search.json").with(:query => {:page => "2", :q => "Erik"}).to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
664
1263
  end
665
- it "should request the correct resource" do
1264
+ it "requests the correct resource" do
666
1265
  @search.users("Erik")
667
1266
  1.upto(50).each do |page|
668
1267
  expect(a_get("/1.1/users/search.json").with(:query => {:page => "1", :q => "Erik"})).to have_been_made
669
1268
  expect(a_get("/1.1/users/search.json").with(:query => {:page => "2", :q => "Erik"})).to have_been_made
670
1269
  end
671
1270
  end
672
- it "should have the correct output" do
1271
+ it "has the correct output" do
673
1272
  @search.users("Erik")
674
1273
  expect($stdout.string.chomp).to eq "pengwynn sferik"
675
1274
  end
@@ -677,7 +1276,7 @@ ID Posted at Screen name Text
677
1276
  before do
678
1277
  @search.options = @search.options.merge("csv" => true)
679
1278
  end
680
- it "should output in CSV format" do
1279
+ it "outputs in CSV format" do
681
1280
  @search.users("Erik")
682
1281
  expect($stdout.string).to eq <<-eos
683
1282
  ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
@@ -690,7 +1289,7 @@ ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name
690
1289
  before do
691
1290
  @search.options = @search.options.merge("long" => true)
692
1291
  end
693
- it "should output in long format" do
1292
+ it "outputs in long format" do
694
1293
  @search.users("Erik")
695
1294
  expect($stdout.string).to eq <<-eos
696
1295
  ID Since Last tweeted at Tweets Favorites Listed Following...
@@ -703,7 +1302,7 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
703
1302
  before do
704
1303
  @search.options = @search.options.merge("reverse" => true)
705
1304
  end
706
- it "should reverse the order of the sort" do
1305
+ it "reverses the order of the sort" do
707
1306
  @search.users("Erik")
708
1307
  expect($stdout.string.chomp).to eq "sferik pengwynn"
709
1308
  end
@@ -712,7 +1311,7 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
712
1311
  before do
713
1312
  @search.options = @search.options.merge("sort" => "favorites")
714
1313
  end
715
- it "should sort by number of favorites" do
1314
+ it "sorts by number of favorites" do
716
1315
  @search.users("Erik")
717
1316
  expect($stdout.string.chomp).to eq "pengwynn sferik"
718
1317
  end
@@ -721,7 +1320,7 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
721
1320
  before do
722
1321
  @search.options = @search.options.merge("sort" => "followers")
723
1322
  end
724
- it "should sort by number of followers" do
1323
+ it "sorts by number of followers" do
725
1324
  @search.users("Erik")
726
1325
  expect($stdout.string.chomp).to eq "sferik pengwynn"
727
1326
  end
@@ -730,7 +1329,7 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
730
1329
  before do
731
1330
  @search.options = @search.options.merge("sort" => "friends")
732
1331
  end
733
- it "should sort by number of friends" do
1332
+ it "sorts by number of friends" do
734
1333
  @search.users("Erik")
735
1334
  expect($stdout.string.chomp).to eq "sferik pengwynn"
736
1335
  end
@@ -739,7 +1338,7 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
739
1338
  before do
740
1339
  @search.options = @search.options.merge("sort" => "listed")
741
1340
  end
742
- it "should sort by number of list memberships" do
1341
+ it "sorts by number of list memberships" do
743
1342
  @search.users("Erik")
744
1343
  expect($stdout.string.chomp).to eq "sferik pengwynn"
745
1344
  end
@@ -748,7 +1347,7 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
748
1347
  before do
749
1348
  @search.options = @search.options.merge("sort" => "since")
750
1349
  end
751
- it "should sort by the time wshen Twitter account was created" do
1350
+ it "sorts by the time wshen Twitter account was created" do
752
1351
  @search.users("Erik")
753
1352
  expect($stdout.string.chomp).to eq "sferik pengwynn"
754
1353
  end
@@ -757,7 +1356,7 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
757
1356
  before do
758
1357
  @search.options = @search.options.merge("sort" => "tweets")
759
1358
  end
760
- it "should sort by number of Tweets" do
1359
+ it "sorts by number of Tweets" do
761
1360
  @search.users("Erik")
762
1361
  expect($stdout.string.chomp).to eq "pengwynn sferik"
763
1362
  end
@@ -766,7 +1365,7 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
766
1365
  before do
767
1366
  @search.options = @search.options.merge("sort" => "tweeted")
768
1367
  end
769
- it "should sort by the time of the last Tweet" do
1368
+ it "sorts by the time of the last Tweet" do
770
1369
  @search.users("Erik")
771
1370
  expect($stdout.string.chomp).to eq "pengwynn sferik"
772
1371
  end
@@ -775,13 +1374,13 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
775
1374
  before do
776
1375
  @search.options = @search.options.merge("unsorted" => true)
777
1376
  end
778
- it "should not be sorted" do
1377
+ it "is not sorted" do
779
1378
  @search.users("Erik")
780
1379
  expect($stdout.string.chomp).to eq "pengwynn sferik"
781
1380
  end
782
1381
  end
783
1382
  context "Twitter is down" do
784
- it "should retry 3 times and then raise an error" do
1383
+ it "retries 3 times and then raise an error" do
785
1384
  stub_get("/1.1/users/search.json").with(:query => {:page => "2", :q => "Erik", }).to_return(:status => 502)
786
1385
  expect do
787
1386
  @search.users("Erik")