t 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,7 +21,7 @@ describe T::Delete do
21
21
  describe "#block" do
22
22
  before do
23
23
  @delete.options = @delete.options.merge("profile" => fixture_path + "/.trc")
24
- stub_post("/1.1/blocks/destroy.json").with(:body => {:screen_name => "sferik"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
24
+ stub_post("/1.1/blocks/destroy.json").with(:body => {:screen_name => "sferik"}).to_return(:body => fixture("sferik.json"))
25
25
  end
26
26
  it "requests the correct resource" do
27
27
  @delete.block("sferik")
@@ -34,7 +34,7 @@ describe T::Delete do
34
34
  context "--id" do
35
35
  before do
36
36
  @delete.options = @delete.options.merge("id" => true)
37
- stub_post("/1.1/blocks/destroy.json").with(:body => {:user_id => "7505382"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
37
+ stub_post("/1.1/blocks/destroy.json").with(:body => {:user_id => "7505382"}).to_return(:body => fixture("sferik.json"))
38
38
  end
39
39
  it "requests the correct resource" do
40
40
  @delete.block("7505382")
@@ -46,8 +46,8 @@ describe T::Delete do
46
46
  describe "#dm" do
47
47
  before do
48
48
  @delete.options = @delete.options.merge("profile" => fixture_path + "/.trc")
49
- stub_get("/1.1/direct_messages/show.json").with(:query => {:id => "1773478249"}).to_return(:body => fixture("direct_message.json"), :headers => {:content_type => "application/json; charset=utf-8"})
50
- stub_post("/1.1/direct_messages/destroy.json").with(:body => {:id => "1773478249"}).to_return(:body => fixture("direct_message.json"), :headers => {:content_type => "application/json; charset=utf-8"})
49
+ stub_get("/1.1/direct_messages/show.json").with(:query => {:id => "1773478249"}).to_return(:body => fixture("direct_message.json"))
50
+ stub_post("/1.1/direct_messages/destroy.json").with(:body => {:id => "1773478249"}).to_return(:body => fixture("direct_message.json"))
51
51
  end
52
52
  it "requests the correct resource" do
53
53
  $stdout.should_receive(:print).with("Are you sure you want to permanently delete the direct message to @pengwynn: \"Creating a fixture for the Twitter gem\"? [y/N] ")
@@ -90,14 +90,14 @@ describe T::Delete do
90
90
  describe "#favorite" do
91
91
  before do
92
92
  @delete.options = @delete.options.merge("profile" => fixture_path + "/.trc")
93
- stub_get("/1.1/statuses/show/28439861609.json").with(:query => {:include_my_retweet => "false", :trim_user => "true"}).to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
94
- stub_post("/1.1/favorites/destroy.json").with(:body => {:id => "28439861609"}).to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
93
+ stub_get("/1.1/statuses/show/28439861609.json").with(:query => {:include_my_retweet => "false"}).to_return(:body => fixture("status.json"))
94
+ stub_post("/1.1/favorites/destroy.json").with(:body => {:id => "28439861609"}).to_return(:body => fixture("status.json"))
95
95
  end
96
96
  it "requests the correct resource" do
97
97
  $stdout.should_receive(:print).with("Are you sure you want to remove @sferik's status: \"The problem with your code is that it's doing exactly what you told it to do.\" from your favorites? [y/N] ")
98
98
  $stdin.should_receive(:gets).and_return("yes")
99
99
  @delete.favorite("28439861609")
100
- expect(a_get("/1.1/statuses/show/28439861609.json").with(:query => {:include_my_retweet => "false", :trim_user => "true"})).to have_been_made
100
+ expect(a_get("/1.1/statuses/show/28439861609.json").with(:query => {:include_my_retweet => "false"})).to have_been_made
101
101
  expect(a_post("/1.1/favorites/destroy.json").with(:body => {:id => "28439861609"})).to have_been_made
102
102
  end
103
103
  context "yes" do
@@ -134,9 +134,9 @@ describe T::Delete do
134
134
  describe "#list" do
135
135
  before do
136
136
  @delete.options = @delete.options.merge("profile" => fixture_path + "/.trc")
137
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
138
- stub_get("/1.1/lists/show.json").with(:query => {:owner_screen_name => "sferik", :slug => 'presidents'}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
139
- stub_post("/1.1/lists/destroy.json").with(:body => {:owner_id => "7505382", :list_id => "8863586"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
137
+ stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"))
138
+ stub_get("/1.1/lists/show.json").with(:query => {:owner_screen_name => "sferik", :slug => 'presidents'}).to_return(:body => fixture("list.json"))
139
+ stub_post("/1.1/lists/destroy.json").with(:body => {:owner_id => "7505382", :list_id => "8863586"}).to_return(:body => fixture("list.json"))
140
140
  end
141
141
  it "requests the correct resource" do
142
142
  $stdout.should_receive(:print).with("Are you sure you want to permanently delete the list \"presidents\"? [y/N] ")
@@ -178,7 +178,7 @@ describe T::Delete do
178
178
  context "--id" do
179
179
  before do
180
180
  @delete.options = @delete.options.merge("id" => true)
181
- stub_get("/1.1/lists/show.json").with(:query => {:owner_screen_name => "sferik", :list_id => "8863586"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
181
+ stub_get("/1.1/lists/show.json").with(:query => {:owner_screen_name => "sferik", :list_id => "8863586"}).to_return(:body => fixture("list.json"))
182
182
  end
183
183
  it "requests the correct resource" do
184
184
  $stdout.should_receive(:print).with("Are you sure you want to permanently delete the list \"presidents\"? [y/N] ")
@@ -194,14 +194,14 @@ describe T::Delete do
194
194
  describe "#status" do
195
195
  before do
196
196
  @delete.options = @delete.options.merge("profile" => fixture_path + "/.trc")
197
- stub_get("/1.1/statuses/show/26755176471724032.json").with(:query => {:include_my_retweet => "false", :trim_user => "true"}).to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
198
- stub_post("/1.1/statuses/destroy/26755176471724032.json").with(:body => {:trim_user => "true"}).to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
197
+ stub_get("/1.1/statuses/show/26755176471724032.json").with(:query => {:include_my_retweet => "false"}).to_return(:body => fixture("status.json"))
198
+ stub_post("/1.1/statuses/destroy/26755176471724032.json").with(:body => {:trim_user => "true"}).to_return(:body => fixture("status.json"))
199
199
  end
200
200
  it "requests the correct resource" do
201
201
  $stdout.should_receive(:print).with("Are you sure you want to permanently delete @sferik's status: \"The problem with your code is that it's doing exactly what you told it to do.\"? [y/N] ")
202
202
  $stdin.should_receive(:gets).and_return("yes")
203
203
  @delete.status("26755176471724032")
204
- expect(a_get("/1.1/statuses/show/26755176471724032.json").with(:query => {:include_my_retweet => "false", :trim_user => "true"})).to have_been_made
204
+ expect(a_get("/1.1/statuses/show/26755176471724032.json").with(:query => {:include_my_retweet => "false"})).to have_been_made
205
205
  expect(a_post("/1.1/statuses/destroy/26755176471724032.json").with(:body => {:trim_user => "true"})).to have_been_made
206
206
  end
207
207
  context "yes" do
@@ -31,8 +31,8 @@ describe T::List do
31
31
  describe "#add" do
32
32
  before do
33
33
  @list.options = @list.options.merge("profile" => fixture_path + "/.trc")
34
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
35
- stub_post("/1.1/lists/members/create_all.json").with(:body => {:screen_name => "BarackObama", :slug => "presidents", :owner_screen_name => "sferik"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
34
+ stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"))
35
+ stub_post("/1.1/lists/members/create_all.json").with(:body => {:screen_name => "BarackObama", :slug => "presidents", :owner_screen_name => "sferik"}).to_return(:body => fixture("list.json"))
36
36
  end
37
37
  it "requests the correct resource" do
38
38
  @list.add("presidents", "BarackObama")
@@ -46,7 +46,7 @@ describe T::List do
46
46
  context "--id" do
47
47
  before do
48
48
  @list.options = @list.options.merge("id" => true)
49
- stub_post("/1.1/lists/members/create_all.json").with(:body => {:user_id => "7505382", :slug => "presidents", :owner_screen_name => "sferik"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
49
+ stub_post("/1.1/lists/members/create_all.json").with(:body => {:user_id => "7505382", :slug => "presidents", :owner_screen_name => "sferik"}).to_return(:body => fixture("list.json"))
50
50
  end
51
51
  it "requests the correct resource" do
52
52
  @list.add("presidents", "7505382")
@@ -68,7 +68,7 @@ describe T::List do
68
68
  describe "#create" do
69
69
  before do
70
70
  @list.options = @list.options.merge("profile" => fixture_path + "/.trc")
71
- stub_post("/1.1/lists/create.json").with(:body => {:name => "presidents"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
71
+ stub_post("/1.1/lists/create.json").with(:body => {:name => "presidents"}).to_return(:body => fixture("list.json"))
72
72
  end
73
73
  it "requests the correct resource" do
74
74
  @list.create("presidents")
@@ -83,7 +83,7 @@ describe T::List do
83
83
  describe "#information" do
84
84
  before do
85
85
  @list.options = @list.options.merge("profile" => fixture_path + "/.trc")
86
- stub_get("/1.1/lists/show.json").with(:query => {:owner_screen_name => "testcli", :slug => "presidents"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
86
+ stub_get("/1.1/lists/show.json").with(:query => {:owner_screen_name => "testcli", :slug => "presidents"}).to_return(:body => fixture("list.json"))
87
87
  end
88
88
  it "requests the correct resource" do
89
89
  @list.information("presidents")
@@ -112,7 +112,7 @@ URL https://twitter.com/sferik/presidents
112
112
  context "--id" do
113
113
  before do
114
114
  @list.options = @list.options.merge("id" => true)
115
- stub_get("/1.1/lists/show.json").with(:query => {:owner_id => "7505382", :slug => "presidents"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
115
+ stub_get("/1.1/lists/show.json").with(:query => {:owner_id => "7505382", :slug => "presidents"}).to_return(:body => fixture("list.json"))
116
116
  end
117
117
  it "requests the correct resource" do
118
118
  @list.information("7505382/presidents")
@@ -136,11 +136,11 @@ ID,Description,Slug,Screen name,Created at,Members,Subscribers,Following,Mode,UR
136
136
 
137
137
  describe "#members" do
138
138
  before do
139
- stub_get("/1.1/lists/members.json").with(:query => {:cursor => "-1", :owner_screen_name => "testcli", :skip_status => "true", :slug => "presidents"}).to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
139
+ stub_get("/1.1/lists/members.json").with(:query => {:cursor => "-1", :owner_screen_name => "testcli", :slug => "presidents"}).to_return(:body => fixture("users_list.json"))
140
140
  end
141
141
  it "requests the correct resource" do
142
142
  @list.members("presidents")
143
- expect(a_get("/1.1/lists/members.json").with(:query => {:cursor => "-1", :owner_screen_name => "testcli", :skip_status => "true", :slug => "presidents"})).to have_been_made
143
+ expect(a_get("/1.1/lists/members.json").with(:query => {:cursor => "-1", :owner_screen_name => "testcli", :slug => "presidents"})).to have_been_made
144
144
  end
145
145
  it "has the correct output" do
146
146
  @list.members("presidents")
@@ -256,16 +256,16 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
256
256
  context "with a user passed" do
257
257
  it "requests the correct resource" do
258
258
  @list.members("testcli/presidents")
259
- expect(a_get("/1.1/lists/members.json").with(:query => {:cursor => "-1", :owner_screen_name => "testcli", :skip_status => "true", :slug => "presidents"})).to have_been_made
259
+ expect(a_get("/1.1/lists/members.json").with(:query => {:cursor => "-1", :owner_screen_name => "testcli", :slug => "presidents"})).to have_been_made
260
260
  end
261
261
  context "--id" do
262
262
  before do
263
263
  @list.options = @list.options.merge("id" => true)
264
- stub_get("/1.1/lists/members.json").with(:query => {:cursor => "-1", :owner_id => "7505382", :skip_status => "true", :slug => "presidents"}).to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
264
+ stub_get("/1.1/lists/members.json").with(:query => {:cursor => "-1", :owner_id => "7505382", :slug => "presidents"}).to_return(:body => fixture("users_list.json"))
265
265
  end
266
266
  it "requests the correct resource" do
267
267
  @list.members("7505382/presidents")
268
- expect(a_get("/1.1/lists/members.json").with(:query => {:cursor => "-1", :owner_id => "7505382", :skip_status => "true", :slug => "presidents"})).to have_been_made
268
+ expect(a_get("/1.1/lists/members.json").with(:query => {:cursor => "-1", :owner_id => "7505382", :slug => "presidents"})).to have_been_made
269
269
  end
270
270
  end
271
271
  end
@@ -274,23 +274,23 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
274
274
  describe "#remove" do
275
275
  before do
276
276
  @list.options = @list.options.merge("profile" => fixture_path + "/.trc")
277
- stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
277
+ stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"))
278
278
  end
279
279
  it "requests the correct resource" do
280
- stub_post("/1.1/lists/members/destroy_all.json").with(:body => {:screen_name => "BarackObama", :slug => "presidents", :owner_screen_name => "sferik"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
280
+ stub_post("/1.1/lists/members/destroy_all.json").with(:body => {:screen_name => "BarackObama", :slug => "presidents", :owner_screen_name => "sferik"}).to_return(:body => fixture("list.json"))
281
281
  @list.remove("presidents", "BarackObama")
282
282
  expect(a_get("/1.1/account/verify_credentials.json")).to have_been_made
283
283
  expect(a_post("/1.1/lists/members/destroy_all.json").with(:body => {:screen_name => "BarackObama", :slug => "presidents", :owner_screen_name => "sferik"})).to have_been_made
284
284
  end
285
285
  it "has the correct output" do
286
- stub_post("/1.1/lists/members/destroy_all.json").with(:body => {:screen_name => "BarackObama", :slug => "presidents", :owner_screen_name => "sferik"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
286
+ stub_post("/1.1/lists/members/destroy_all.json").with(:body => {:screen_name => "BarackObama", :slug => "presidents", :owner_screen_name => "sferik"}).to_return(:body => fixture("list.json"))
287
287
  @list.remove("presidents", "BarackObama")
288
288
  expect($stdout.string.split("\n").first).to eq "@testcli removed 1 member from the list \"presidents\"."
289
289
  end
290
290
  context "--id" do
291
291
  before do
292
292
  @list.options = @list.options.merge("id" => true)
293
- stub_post("/1.1/lists/members/destroy_all.json").with(:body => {:user_id => "7505382", :slug => "presidents", :owner_screen_name => "sferik"}).to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
293
+ stub_post("/1.1/lists/members/destroy_all.json").with(:body => {:user_id => "7505382", :slug => "presidents", :owner_screen_name => "sferik"}).to_return(:body => fixture("list.json"))
294
294
  end
295
295
  it "requests the correct resource" do
296
296
  @list.remove("presidents", "7505382")
@@ -311,7 +311,8 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
311
311
 
312
312
  describe "#timeline" do
313
313
  before do
314
- stub_get("/1.1/lists/statuses.json").with(:query => {:owner_screen_name => "testcli", :count => "20", :slug => "presidents"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
314
+ @list.options = @list.options.merge("color" => "always")
315
+ stub_get("/1.1/lists/statuses.json").with(:query => {:owner_screen_name => "testcli", :count => "20", :slug => "presidents"}).to_return(:body => fixture("statuses.json"))
315
316
  end
316
317
  it "requests the correct resource" do
317
318
  @list.timeline("presidents")
@@ -397,6 +398,258 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
397
398
 
398
399
  eos
399
400
  end
401
+ context "--color=never" do
402
+ before do
403
+ @list.options = @list.options.merge("color" => "never")
404
+ end
405
+ it "outputs without color" do
406
+ @list.timeline("presidents")
407
+ expect($stdout.string).to eq <<-eos
408
+ @mutgoff
409
+ Happy Birthday @imdane. Watch out for those @rally pranksters!
410
+
411
+ @ironicsans
412
+ If you like good real-life stories, check out @NarrativelyNY's just-launched
413
+ site http://t.co/wiUL07jE (and also visit http://t.co/ZoyQxqWA)
414
+
415
+ @pat_shaughnessy
416
+ Something else to vote for: "New Rails workshops to bring more women into the
417
+ Boston software scene" http://t.co/eNBuckHc /cc @bostonrb
418
+
419
+ @calebelston
420
+ Pushing the button to launch the site. http://t.co/qLoEn5jG
421
+
422
+ @calebelston
423
+ RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
424
+
425
+ @fivethirtyeight
426
+ The Weatherman is Not a Moron: http://t.co/ZwL5Gnq5. An excerpt from my book,
427
+ THE SIGNAL AND THE NOISE (http://t.co/fNXj8vCE)
428
+
429
+ @codeforamerica
430
+ RT @randomhacks: Going to Code Across Austin II: Y'all Come Hack Now, Sat,
431
+ Sep 8 http://t.co/Sk5BM7U3 We'll see y'all there! #rhok @codeforamerica
432
+ @TheaClay
433
+
434
+ @fbjork
435
+ RT @jondot: Just published: "Pragmatic Concurrency With #Ruby"
436
+ http://t.co/kGEykswZ /cc @JRuby @headius
437
+
438
+ @mbostock
439
+ If you are wondering how we computed the split bubbles: http://t.co/BcaqSs5u
440
+
441
+ @FakeDorsey
442
+ “Write drunk. Edit sober.”—Ernest Hemingway
443
+
444
+ @al3x
445
+ RT @wcmaier: Better banking through better ops: build something new with us
446
+ @Simplify (remote, PDX) http://t.co/8WgzKZH3
447
+
448
+ @calebelston
449
+ We just announced Mosaic, what we've been working on since the Yobongo
450
+ acquisition. My personal post, http://t.co/ELOyIRZU @heymosaic
451
+
452
+ @BarackObama
453
+ Donate $10 or more --> get your favorite car magnet: http://t.co/NfRhl2s2
454
+ #Obama2012
455
+
456
+ @JEG2
457
+ RT @tenderlove: If corporations are people, can we use them to drive in the
458
+ carpool lane?
459
+
460
+ @eveningedition
461
+ LDN—Obama's nomination; Putin woos APEC; Bombs hit Damascus; Quakes shake
462
+ China; Canada cuts Iran ties; weekend read: http://t.co/OFs6dVW4
463
+
464
+ @dhh
465
+ RT @ggreenwald: Democrats parade Osama bin Laden's corpse as their proudest
466
+ achievement: why this goulish jingoism is so warped http://t.co/kood278s
467
+
468
+ @jasonfried
469
+ The story of Mars Curiosity's gears, made by a factory in Rockford, IL:
470
+ http://t.co/MwCRsHQg
471
+
472
+ @sferik
473
+ @episod @twitterapi now https://t.co/I17jUTu2 and https://t.co/deDu4Hgw seem
474
+ to be missing "1.1" from the URL.
475
+
476
+ @sferik
477
+ @episod @twitterapi Did you catch https://t.co/VHsQvZT0 as well?
478
+
479
+ @dwiskus
480
+ Gentlemen, you can't fight in here! This is the war room!
481
+ http://t.co/kMxMYyqF
482
+
483
+ eos
484
+ end
485
+ end
486
+ context "--color=auto" do
487
+ before do
488
+ @list.options = @list.options.merge("color" => "auto")
489
+ end
490
+ it "outputs without color when stdout is not a tty" do
491
+ @list.timeline("presidents")
492
+ expect($stdout.string).to eq <<-eos
493
+ @mutgoff
494
+ Happy Birthday @imdane. Watch out for those @rally pranksters!
495
+
496
+ @ironicsans
497
+ If you like good real-life stories, check out @NarrativelyNY's just-launched
498
+ site http://t.co/wiUL07jE (and also visit http://t.co/ZoyQxqWA)
499
+
500
+ @pat_shaughnessy
501
+ Something else to vote for: "New Rails workshops to bring more women into the
502
+ Boston software scene" http://t.co/eNBuckHc /cc @bostonrb
503
+
504
+ @calebelston
505
+ Pushing the button to launch the site. http://t.co/qLoEn5jG
506
+
507
+ @calebelston
508
+ RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
509
+
510
+ @fivethirtyeight
511
+ The Weatherman is Not a Moron: http://t.co/ZwL5Gnq5. An excerpt from my book,
512
+ THE SIGNAL AND THE NOISE (http://t.co/fNXj8vCE)
513
+
514
+ @codeforamerica
515
+ RT @randomhacks: Going to Code Across Austin II: Y'all Come Hack Now, Sat,
516
+ Sep 8 http://t.co/Sk5BM7U3 We'll see y'all there! #rhok @codeforamerica
517
+ @TheaClay
518
+
519
+ @fbjork
520
+ RT @jondot: Just published: "Pragmatic Concurrency With #Ruby"
521
+ http://t.co/kGEykswZ /cc @JRuby @headius
522
+
523
+ @mbostock
524
+ If you are wondering how we computed the split bubbles: http://t.co/BcaqSs5u
525
+
526
+ @FakeDorsey
527
+ “Write drunk. Edit sober.”—Ernest Hemingway
528
+
529
+ @al3x
530
+ RT @wcmaier: Better banking through better ops: build something new with us
531
+ @Simplify (remote, PDX) http://t.co/8WgzKZH3
532
+
533
+ @calebelston
534
+ We just announced Mosaic, what we've been working on since the Yobongo
535
+ acquisition. My personal post, http://t.co/ELOyIRZU @heymosaic
536
+
537
+ @BarackObama
538
+ Donate $10 or more --> get your favorite car magnet: http://t.co/NfRhl2s2
539
+ #Obama2012
540
+
541
+ @JEG2
542
+ RT @tenderlove: If corporations are people, can we use them to drive in the
543
+ carpool lane?
544
+
545
+ @eveningedition
546
+ LDN—Obama's nomination; Putin woos APEC; Bombs hit Damascus; Quakes shake
547
+ China; Canada cuts Iran ties; weekend read: http://t.co/OFs6dVW4
548
+
549
+ @dhh
550
+ RT @ggreenwald: Democrats parade Osama bin Laden's corpse as their proudest
551
+ achievement: why this goulish jingoism is so warped http://t.co/kood278s
552
+
553
+ @jasonfried
554
+ The story of Mars Curiosity's gears, made by a factory in Rockford, IL:
555
+ http://t.co/MwCRsHQg
556
+
557
+ @sferik
558
+ @episod @twitterapi now https://t.co/I17jUTu2 and https://t.co/deDu4Hgw seem
559
+ to be missing "1.1" from the URL.
560
+
561
+ @sferik
562
+ @episod @twitterapi Did you catch https://t.co/VHsQvZT0 as well?
563
+
564
+ @dwiskus
565
+ Gentlemen, you can't fight in here! This is the war room!
566
+ http://t.co/kMxMYyqF
567
+
568
+ eos
569
+ end
570
+ it "outputs with color when stdout is a tty" do
571
+ $stdout.stub!(:"tty?").and_return(true)
572
+ @list.timeline("presidents")
573
+ expect($stdout.string).to eq <<-eos
574
+ \e[1m\e[33m @mutgoff\e[0m
575
+ Happy Birthday @imdane. Watch out for those @rally pranksters!
576
+
577
+ \e[1m\e[33m @ironicsans\e[0m
578
+ If you like good real-life stories, check out @NarrativelyNY's just-launched
579
+ site http://t.co/wiUL07jE (and also visit http://t.co/ZoyQxqWA)
580
+
581
+ \e[1m\e[33m @pat_shaughnessy\e[0m
582
+ Something else to vote for: "New Rails workshops to bring more women into the
583
+ Boston software scene" http://t.co/eNBuckHc /cc @bostonrb
584
+
585
+ \e[1m\e[33m @calebelston\e[0m
586
+ Pushing the button to launch the site. http://t.co/qLoEn5jG
587
+
588
+ \e[1m\e[33m @calebelston\e[0m
589
+ RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
590
+
591
+ \e[1m\e[33m @fivethirtyeight\e[0m
592
+ The Weatherman is Not a Moron: http://t.co/ZwL5Gnq5. An excerpt from my book,
593
+ THE SIGNAL AND THE NOISE (http://t.co/fNXj8vCE)
594
+
595
+ \e[1m\e[33m @codeforamerica\e[0m
596
+ RT @randomhacks: Going to Code Across Austin II: Y'all Come Hack Now, Sat,
597
+ Sep 8 http://t.co/Sk5BM7U3 We'll see y'all there! #rhok @codeforamerica
598
+ @TheaClay
599
+
600
+ \e[1m\e[33m @fbjork\e[0m
601
+ RT @jondot: Just published: "Pragmatic Concurrency With #Ruby"
602
+ http://t.co/kGEykswZ /cc @JRuby @headius
603
+
604
+ \e[1m\e[33m @mbostock\e[0m
605
+ If you are wondering how we computed the split bubbles: http://t.co/BcaqSs5u
606
+
607
+ \e[1m\e[33m @FakeDorsey\e[0m
608
+ “Write drunk. Edit sober.”—Ernest Hemingway
609
+
610
+ \e[1m\e[33m @al3x\e[0m
611
+ RT @wcmaier: Better banking through better ops: build something new with us
612
+ @Simplify (remote, PDX) http://t.co/8WgzKZH3
613
+
614
+ \e[1m\e[33m @calebelston\e[0m
615
+ We just announced Mosaic, what we've been working on since the Yobongo
616
+ acquisition. My personal post, http://t.co/ELOyIRZU @heymosaic
617
+
618
+ \e[1m\e[33m @BarackObama\e[0m
619
+ Donate $10 or more --> get your favorite car magnet: http://t.co/NfRhl2s2
620
+ #Obama2012
621
+
622
+ \e[1m\e[33m @JEG2\e[0m
623
+ RT @tenderlove: If corporations are people, can we use them to drive in the
624
+ carpool lane?
625
+
626
+ \e[1m\e[33m @eveningedition\e[0m
627
+ LDN—Obama's nomination; Putin woos APEC; Bombs hit Damascus; Quakes shake
628
+ China; Canada cuts Iran ties; weekend read: http://t.co/OFs6dVW4
629
+
630
+ \e[1m\e[33m @dhh\e[0m
631
+ RT @ggreenwald: Democrats parade Osama bin Laden's corpse as their proudest
632
+ achievement: why this goulish jingoism is so warped http://t.co/kood278s
633
+
634
+ \e[1m\e[33m @jasonfried\e[0m
635
+ The story of Mars Curiosity's gears, made by a factory in Rockford, IL:
636
+ http://t.co/MwCRsHQg
637
+
638
+ \e[1m\e[33m @sferik\e[0m
639
+ @episod @twitterapi now https://t.co/I17jUTu2 and https://t.co/deDu4Hgw seem
640
+ to be missing "1.1" from the URL.
641
+
642
+ \e[1m\e[33m @sferik\e[0m
643
+ @episod @twitterapi Did you catch https://t.co/VHsQvZT0 as well?
644
+
645
+ \e[1m\e[33m @dwiskus\e[0m
646
+ Gentlemen, you can't fight in here! This is the war room!
647
+ http://t.co/kMxMYyqF
648
+
649
+ eos
650
+ end
651
+ end
652
+
400
653
  context "--csv" do
401
654
  before do
402
655
  @list.options = @list.options.merge("csv" => true)
@@ -492,9 +745,9 @@ ID Posted at Screen name Text
492
745
  end
493
746
  context "--number" do
494
747
  before do
495
- stub_get("/1.1/lists/statuses.json").with(:query => {:owner_screen_name => "testcli", :count => "1", :slug => "presidents"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
496
- stub_get("/1.1/lists/statuses.json").with(:query => {:owner_screen_name => "testcli", :count => "200", :slug => "presidents"}).to_return(:body => fixture("200_statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
497
- stub_get("/1.1/lists/statuses.json").with(:query => {:owner_screen_name => "testcli", :count => "1", :max_id => "265500541700956160", :slug => "presidents"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
748
+ stub_get("/1.1/lists/statuses.json").with(:query => {:owner_screen_name => "testcli", :count => "1", :slug => "presidents"}).to_return(:body => fixture("statuses.json"))
749
+ stub_get("/1.1/lists/statuses.json").with(:query => {:owner_screen_name => "testcli", :count => "200", :slug => "presidents"}).to_return(:body => fixture("200_statuses.json"))
750
+ stub_get("/1.1/lists/statuses.json").with(:query => {:owner_screen_name => "testcli", :count => "1", :max_id => "265500541700956160", :slug => "presidents"}).to_return(:body => fixture("statuses.json"))
498
751
  end
499
752
  it "limits the number of results to 1" do
500
753
  @list.options = @list.options.merge("number" => 1)
@@ -516,7 +769,7 @@ ID Posted at Screen name Text
516
769
  context "--id" do
517
770
  before do
518
771
  @list.options = @list.options.merge("id" => true)
519
- stub_get("/1.1/lists/statuses.json").with(:query => {:owner_id => "7505382", :count => "20", :slug => "presidents"}).to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
772
+ stub_get("/1.1/lists/statuses.json").with(:query => {:owner_id => "7505382", :count => "20", :slug => "presidents"}).to_return(:body => fixture("statuses.json"))
520
773
  end
521
774
  it "requests the correct resource" do
522
775
  @list.timeline("7505382/presidents")