t 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/t/search.rb CHANGED
@@ -3,7 +3,6 @@ require 'csv'
3
3
  # 'fastercsv' required on Ruby versions < 1.9
4
4
  require 'fastercsv' unless Array.new.respond_to?(:to_csv)
5
5
  require 'htmlentities'
6
- require 'retryable'
7
6
  require 't/collectable'
8
7
  require 't/printable'
9
8
  require 't/rcfile'
@@ -20,6 +19,7 @@ module T
20
19
  DEFAULT_NUM_RESULTS = 20
21
20
  MAX_NUM_RESULTS = 200
22
21
  MAX_SCREEN_NAME_SIZE = 20
22
+ MAX_USERS_PER_REQUEST = 20
23
23
 
24
24
  check_unknown_options!
25
25
 
@@ -28,7 +28,7 @@ module T
28
28
  @rcfile = RCFile.instance
29
29
  end
30
30
 
31
- desc "all QUERY", "Returns the #{DEFAULT_NUM_RESULTS} most recent Tweets that match a specified query."
31
+ desc "all QUERY", "Returns the #{DEFAULT_NUM_RESULTS} most recent Tweets that match the specified query."
32
32
  method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
33
33
  method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
34
34
  method_option "number", :aliases => "-n", :type => :numeric, :default => DEFAULT_NUM_RESULTS
@@ -38,47 +38,32 @@ module T
38
38
  client.search(query, opts)
39
39
  end
40
40
  if options['csv']
41
- say ["ID", "Posted at", "Screen name", "Text"].to_csv unless statuses.empty?
41
+ say STATUS_HEADINGS.to_csv unless statuses.empty?
42
42
  statuses.each do |status|
43
- say [status.id, status.created_at.utc.strftime("%Y-%m-%d %H:%M:%S %z"), status.from_user, HTMLEntities.new.decode(status.text)].to_csv
43
+ say [status.id, csv_formatted_time(status), status.from_user, HTMLEntities.new.decode(status.text)].to_csv
44
44
  end
45
45
  elsif options['long']
46
46
  array = statuses.map do |status|
47
- created_at = status.created_at > 6.months.ago ? status.created_at.strftime("%b %e %H:%M") : status.created_at.strftime("%b %e %Y")
48
- [status.id, created_at, "@#{status.from_user}", HTMLEntities.new.decode(status.text).gsub(/\n+/, ' ')]
49
- end
50
- if STDOUT.tty?
51
- headings = ["ID", "Posted at", "Screen name", "Text"]
52
- array.unshift(headings) unless statuses.empty?
53
- print_table(array, :truncate => true)
54
- else
55
- print_table(array)
47
+ [status.id, ls_formatted_time(status), "@#{status.from_user}", HTMLEntities.new.decode(status.text).gsub(/\n+/, ' ')]
56
48
  end
49
+ print_table_with_headings(array, STATUS_HEADINGS)
57
50
  else
58
51
  say unless statuses.empty?
59
52
  statuses.each do |status|
60
- if STDOUT.tty? && !options['no-color']
61
- say(" @#{status.from_user}", [:bold, :yellow])
62
- else
63
- say(" @#{status.from_user}")
64
- end
65
- print_wrapped(HTMLEntities.new.decode(status.text), :indent => 3)
66
- say
53
+ print_status(status)
67
54
  end
68
55
  end
69
56
  end
70
57
 
71
- desc "favorites QUERY", "Returns Tweets you've favorited that match a specified query."
58
+ desc "favorites QUERY", "Returns Tweets you've favorited that match the specified query."
72
59
  method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
73
60
  method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
74
61
  def favorites(query)
75
62
  opts = {:count => MAX_NUM_RESULTS}
76
63
  statuses = collect_with_max_id do |max_id|
77
64
  opts[:max_id] = max_id unless max_id.nil?
78
- retryable(:tries => 3, :on => Twitter::Error::ServerError, :sleep => 0) do
79
- client.favorites(opts)
80
- end
81
- end.flatten.compact
65
+ client.favorites(opts)
66
+ end
82
67
  statuses = statuses.select do |status|
83
68
  /#{query}/i.match(status.text)
84
69
  end
@@ -105,27 +90,23 @@ module T
105
90
  opts = {:count => MAX_NUM_RESULTS}
106
91
  statuses = collect_with_max_id do |max_id|
107
92
  opts[:max_id] = max_id unless max_id.nil?
108
- retryable(:tries => 3, :on => Twitter::Error::ServerError, :sleep => 0) do
109
- client.list_timeline(owner, list, opts)
110
- end
111
- end.flatten.compact
93
+ client.list_timeline(owner, list, opts)
94
+ end
112
95
  statuses = statuses.select do |status|
113
96
  /#{query}/i.match(status.text)
114
97
  end
115
98
  print_statuses(statuses)
116
99
  end
117
100
 
118
- desc "mentions QUERY", "Returns Tweets mentioning you that match a specified query."
101
+ desc "mentions QUERY", "Returns Tweets mentioning you that match the specified query."
119
102
  method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
120
103
  method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
121
104
  def mentions(query)
122
105
  opts = {:count => MAX_NUM_RESULTS}
123
106
  statuses = collect_with_max_id do |max_id|
124
107
  opts[:max_id] = max_id unless max_id.nil?
125
- retryable(:tries => 3, :on => Twitter::Error::ServerError, :sleep => 0) do
126
- client.mentions(opts)
127
- end
128
- end.flatten.compact
108
+ client.mentions(opts)
109
+ end
129
110
  statuses = statuses.select do |status|
130
111
  /#{query}/i.match(status.text)
131
112
  end
@@ -133,17 +114,15 @@ module T
133
114
  end
134
115
  map %w(replies) => :mentions
135
116
 
136
- desc "retweets QUERY", "Returns Tweets you've retweeted that match a specified query."
117
+ desc "retweets QUERY", "Returns Tweets you've retweeted that match the specified query."
137
118
  method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
138
119
  method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
139
120
  def retweets(query)
140
121
  opts = {:count => MAX_NUM_RESULTS}
141
122
  statuses = collect_with_max_id do |max_id|
142
123
  opts[:max_id] = max_id unless max_id.nil?
143
- retryable(:tries => 3, :on => Twitter::Error::ServerError, :sleep => 0) do
144
- client.retweeted_by(opts)
145
- end
146
- end.flatten.compact
124
+ client.retweeted_by(opts)
125
+ end
147
126
  statuses = statuses.select do |status|
148
127
  /#{query}/i.match(status.text)
149
128
  end
@@ -151,17 +130,30 @@ module T
151
130
  end
152
131
  map %w(rts) => :retweets
153
132
 
154
- desc "timeline QUERY", "Returns Tweets in your timeline that match a specified query."
133
+ desc "timeline QUERY", "Returns Tweets in your timeline that match the specified query."
155
134
  method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
135
+ method_option "id", :aliases => "-i", :type => "boolean", :default => false, :desc => "Specify user via ID instead of screen name."
156
136
  method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
157
- def timeline(query)
137
+ def timeline(*args)
158
138
  opts = {:count => MAX_NUM_RESULTS}
159
- statuses = collect_with_max_id do |max_id|
160
- opts[:max_id] = max_id unless max_id.nil?
161
- retryable(:tries => 3, :on => Twitter::Error::ServerError, :sleep => 0) do
139
+ query = args.pop
140
+ user = args.pop
141
+ if user
142
+ user = if options['id']
143
+ user.to_i
144
+ else
145
+ user.strip_ats
146
+ end
147
+ statuses = collect_with_max_id do |max_id|
148
+ opts[:max_id] = max_id unless max_id.nil?
149
+ client.user_timeline(user, opts)
150
+ end
151
+ else
152
+ statuses = collect_with_max_id do |max_id|
153
+ opts[:max_id] = max_id unless max_id.nil?
162
154
  client.home_timeline(opts)
163
155
  end
164
- end.flatten.compact
156
+ end
165
157
  statuses = statuses.select do |status|
166
158
  /#{query}/i.match(status.text)
167
159
  end
@@ -169,27 +161,24 @@ module T
169
161
  end
170
162
  map %w(tl) => :timeline
171
163
 
172
- desc "user USER QUERY", "Returns Tweets in a user's timeline that match a specified query."
164
+ desc "users QUERY", "Returns users that match the specified query."
173
165
  method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
174
- method_option "id", :aliases => "-i", :type => "boolean", :default => false, :desc => "Specify user via ID instead of screen name."
166
+ method_option "favorites", :aliases => "-v", :type => :boolean, :default => false, :desc => "Sort by number of favorites."
167
+ method_option "followers", :aliases => "-f", :type => :boolean, :default => false, :desc => "Sort by number of followers."
168
+ method_option "friends", :aliases => "-e", :type => :boolean, :default => false, :desc => "Sort by number of friends."
169
+ method_option "listed", :aliases => "-d", :type => :boolean, :default => false, :desc => "Sort by number of list memberships."
175
170
  method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
176
- def user(user, query)
177
- user = if options['id']
178
- user.to_i
179
- else
180
- user.strip_ats
181
- end
182
- opts = {:count => MAX_NUM_RESULTS}
183
- statuses = collect_with_max_id do |max_id|
184
- opts[:max_id] = max_id unless max_id.nil?
171
+ method_option "posted", :aliases => "-p", :type => :boolean, :default => false, :desc => "Sort by the time when Twitter account was posted."
172
+ method_option "reverse", :aliases => "-r", :type => :boolean, :default => false, :desc => "Reverse the order of the sort."
173
+ method_option "tweets", :aliases => "-t", :type => :boolean, :default => false, :desc => "Sort by number of Tweets."
174
+ method_option "unsorted", :aliases => "-u", :type => :boolean, :default => false, :desc => "Output is not sorted."
175
+ def users(query)
176
+ users = 1.upto(50).threaded_map do |page|
185
177
  retryable(:tries => 3, :on => Twitter::Error::ServerError, :sleep => 0) do
186
- client.user_timeline(user, opts)
178
+ client.user_search(query, :page => page, :per_page => MAX_USERS_PER_REQUEST)
187
179
  end
188
- end.flatten.compact
189
- statuses = statuses.select do |status|
190
- /#{query}/i.match(status.text)
191
- end
192
- print_statuses(statuses)
180
+ end.flatten
181
+ print_users(users)
193
182
  end
194
183
 
195
184
  end
data/lib/t/stream.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 't/cli'
1
2
  require 't/printable'
2
3
  require 't/rcfile'
3
4
  require 't/search'
@@ -17,7 +18,7 @@ module T
17
18
  method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
18
19
  def all
19
20
  if options['csv']
20
- say status_headings.to_csv
21
+ say STATUS_HEADINGS.to_csv
21
22
  end
22
23
  client.on_timeline_status do |status|
23
24
  if options['csv']
@@ -26,10 +27,7 @@ module T
26
27
  print_status(status)
27
28
  end
28
29
  end
29
- Signal.trap("TERM") do
30
- client.stop
31
- shutdown
32
- end
30
+ until_term
33
31
  client.sample
34
32
  end
35
33
 
@@ -38,10 +36,7 @@ module T
38
36
  client.on_timeline_status do |status|
39
37
  say(status.text.gsub("\n", ''), [:bold, :green, :on_black])
40
38
  end
41
- Signal.trap("TERM") do
42
- client.stop
43
- shutdown
44
- end
39
+ until_term
45
40
  client.sample
46
41
  end
47
42
 
@@ -62,10 +57,7 @@ module T
62
57
  print_status(status)
63
58
  end
64
59
  end
65
- Signal.trap("TERM") do
66
- client.stop
67
- shutdown
68
- end
60
+ until_term
69
61
  client.track(keywords)
70
62
  end
71
63
 
@@ -85,10 +77,7 @@ module T
85
77
  print_status(status)
86
78
  end
87
79
  end
88
- Signal.trap("TERM") do
89
- client.stop
90
- shutdown
91
- end
80
+ until_term
92
81
  client.userstream
93
82
  end
94
83
 
@@ -96,7 +85,7 @@ module T
96
85
  method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
97
86
  def users(screen_name, *screen_names)
98
87
  if options['csv']
99
- say status_headings.to_csv
88
+ say STATUS_HEADINGS.to_csv
100
89
  end
101
90
  screen_names.unshift(screen_name)
102
91
  client.on_timeline_status do |status|
@@ -106,10 +95,7 @@ module T
106
95
  print_status(status)
107
96
  end
108
97
  end
109
- Signal.trap("TERM") do
110
- client.stop
111
- shutdown
112
- end
98
+ until_term
113
99
  client.follow(screen_names)
114
100
  end
115
101
 
@@ -126,5 +112,12 @@ module T
126
112
  )
127
113
  end
128
114
 
115
+ def until_term
116
+ Signal.trap("TERM") do
117
+ client.stop
118
+ shutdown
119
+ end
120
+ end
121
+
129
122
  end
130
123
  end
data/lib/t/version.rb CHANGED
@@ -13,7 +13,7 @@ module T
13
13
 
14
14
  # @return [Integer]
15
15
  def self.patch
16
- 5
16
+ 6
17
17
  end
18
18
 
19
19
  # @return [String, NilClass]
data/spec/cli_spec.rb CHANGED
@@ -368,7 +368,7 @@ ID Posted at Screen name Text
368
368
  end
369
369
  it "should have the correct output" do
370
370
  @cli.disciples
371
- $stdout.string.rstrip.should == "@pengwynn @sferik"
371
+ $stdout.string.rstrip.should == "pengwynn sferik"
372
372
  end
373
373
  context "--csv" do
374
374
  before do
@@ -389,7 +389,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
389
389
  end
390
390
  it "should sort by number of favorites" do
391
391
  @cli.disciples
392
- $stdout.string.rstrip.should == "@pengwynn @sferik"
392
+ $stdout.string.rstrip.should == "pengwynn sferik"
393
393
  end
394
394
  end
395
395
  context "--followers" do
@@ -398,7 +398,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
398
398
  end
399
399
  it "should sort by number of followers" do
400
400
  @cli.disciples
401
- $stdout.string.rstrip.should == "@sferik @pengwynn"
401
+ $stdout.string.rstrip.should == "sferik pengwynn"
402
402
  end
403
403
  end
404
404
  context "--friends" do
@@ -407,7 +407,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
407
407
  end
408
408
  it "should sort by number of friends" do
409
409
  @cli.disciples
410
- $stdout.string.rstrip.should == "@sferik @pengwynn"
410
+ $stdout.string.rstrip.should == "sferik pengwynn"
411
411
  end
412
412
  end
413
413
  context "--listed" do
@@ -416,7 +416,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
416
416
  end
417
417
  it "should sort by number of list memberships" do
418
418
  @cli.disciples
419
- $stdout.string.rstrip.should == "@sferik @pengwynn"
419
+ $stdout.string.rstrip.should == "sferik pengwynn"
420
420
  end
421
421
  end
422
422
  context "--long" do
@@ -438,7 +438,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
438
438
  end
439
439
  it "should sort by the time when Twitter acount was created" do
440
440
  @cli.disciples
441
- $stdout.string.rstrip.should == "@sferik @pengwynn"
441
+ $stdout.string.rstrip.should == "sferik pengwynn"
442
442
  end
443
443
  end
444
444
  context "--reverse" do
@@ -447,7 +447,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
447
447
  end
448
448
  it "should reverse the order of the sort" do
449
449
  @cli.disciples
450
- $stdout.string.rstrip.should == "@sferik @pengwynn"
450
+ $stdout.string.rstrip.should == "sferik pengwynn"
451
451
  end
452
452
  end
453
453
  context "--tweets" do
@@ -456,7 +456,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
456
456
  end
457
457
  it "should sort by number of Tweets" do
458
458
  @cli.disciples
459
- $stdout.string.rstrip.should == "@sferik @pengwynn"
459
+ $stdout.string.rstrip.should == "sferik pengwynn"
460
460
  end
461
461
  end
462
462
  context "--unsorted" do
@@ -465,7 +465,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
465
465
  end
466
466
  it "should not be sorted" do
467
467
  @cli.disciples
468
- $stdout.string.rstrip.should == "@sferik @pengwynn"
468
+ $stdout.string.rstrip.should == "sferik pengwynn"
469
469
  end
470
470
  end
471
471
  context "with a user passed" do
@@ -969,7 +969,7 @@ ID Posted at Screen name Text
969
969
  end
970
970
  it "should have the correct output" do
971
971
  @cli.followings
972
- $stdout.string.rstrip.should == "@pengwynn @sferik"
972
+ $stdout.string.rstrip.should == "pengwynn sferik"
973
973
  end
974
974
  context "--csv" do
975
975
  before do
@@ -990,7 +990,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
990
990
  end
991
991
  it "should sort by number of favorites" do
992
992
  @cli.followings
993
- $stdout.string.rstrip.should == "@pengwynn @sferik"
993
+ $stdout.string.rstrip.should == "pengwynn sferik"
994
994
  end
995
995
  end
996
996
  context "--followers" do
@@ -999,7 +999,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
999
999
  end
1000
1000
  it "should sort by number of followers" do
1001
1001
  @cli.followings
1002
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1002
+ $stdout.string.rstrip.should == "sferik pengwynn"
1003
1003
  end
1004
1004
  end
1005
1005
  context "--friends" do
@@ -1008,7 +1008,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
1008
1008
  end
1009
1009
  it "should sort by number of friends" do
1010
1010
  @cli.followings
1011
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1011
+ $stdout.string.rstrip.should == "sferik pengwynn"
1012
1012
  end
1013
1013
  end
1014
1014
  context "--listed" do
@@ -1017,7 +1017,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
1017
1017
  end
1018
1018
  it "should sort by number of list memberships" do
1019
1019
  @cli.followings
1020
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1020
+ $stdout.string.rstrip.should == "sferik pengwynn"
1021
1021
  end
1022
1022
  end
1023
1023
  context "--long" do
@@ -1039,7 +1039,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1039
1039
  end
1040
1040
  it "should sort by the time when Twitter acount was created" do
1041
1041
  @cli.followings
1042
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1042
+ $stdout.string.rstrip.should == "sferik pengwynn"
1043
1043
  end
1044
1044
  end
1045
1045
  context "--reverse" do
@@ -1048,7 +1048,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1048
1048
  end
1049
1049
  it "should reverse the order of the sort" do
1050
1050
  @cli.followings
1051
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1051
+ $stdout.string.rstrip.should == "sferik pengwynn"
1052
1052
  end
1053
1053
  end
1054
1054
  context "--tweets" do
@@ -1057,7 +1057,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1057
1057
  end
1058
1058
  it "should sort by number of Tweets" do
1059
1059
  @cli.followings
1060
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1060
+ $stdout.string.rstrip.should == "sferik pengwynn"
1061
1061
  end
1062
1062
  end
1063
1063
  context "--unsorted" do
@@ -1066,7 +1066,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1066
1066
  end
1067
1067
  it "should not be sorted" do
1068
1068
  @cli.followings
1069
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1069
+ $stdout.string.rstrip.should == "sferik pengwynn"
1070
1070
  end
1071
1071
  end
1072
1072
  context "with a user passed" do
@@ -1124,7 +1124,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1124
1124
  end
1125
1125
  it "should have the correct output" do
1126
1126
  @cli.followers
1127
- $stdout.string.rstrip.should == "@pengwynn @sferik"
1127
+ $stdout.string.rstrip.should == "pengwynn sferik"
1128
1128
  end
1129
1129
  context "--csv" do
1130
1130
  before do
@@ -1145,7 +1145,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
1145
1145
  end
1146
1146
  it "should sort by number of favorites" do
1147
1147
  @cli.followers
1148
- $stdout.string.rstrip.should == "@pengwynn @sferik"
1148
+ $stdout.string.rstrip.should == "pengwynn sferik"
1149
1149
  end
1150
1150
  end
1151
1151
  context "--followers" do
@@ -1154,7 +1154,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
1154
1154
  end
1155
1155
  it "should sort by number of followers" do
1156
1156
  @cli.followers
1157
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1157
+ $stdout.string.rstrip.should == "sferik pengwynn"
1158
1158
  end
1159
1159
  end
1160
1160
  context "--friends" do
@@ -1163,7 +1163,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
1163
1163
  end
1164
1164
  it "should sort by number of friends" do
1165
1165
  @cli.followers
1166
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1166
+ $stdout.string.rstrip.should == "sferik pengwynn"
1167
1167
  end
1168
1168
  end
1169
1169
  context "--listed" do
@@ -1172,7 +1172,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
1172
1172
  end
1173
1173
  it "should sort by number of list memberships" do
1174
1174
  @cli.followers
1175
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1175
+ $stdout.string.rstrip.should == "sferik pengwynn"
1176
1176
  end
1177
1177
  end
1178
1178
  context "--long" do
@@ -1194,7 +1194,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1194
1194
  end
1195
1195
  it "should sort by the time when Twitter acount was created" do
1196
1196
  @cli.followers
1197
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1197
+ $stdout.string.rstrip.should == "sferik pengwynn"
1198
1198
  end
1199
1199
  end
1200
1200
  context "--reverse" do
@@ -1203,7 +1203,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1203
1203
  end
1204
1204
  it "should reverse the order of the sort" do
1205
1205
  @cli.followers
1206
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1206
+ $stdout.string.rstrip.should == "sferik pengwynn"
1207
1207
  end
1208
1208
  end
1209
1209
  context "--tweets" do
@@ -1212,7 +1212,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1212
1212
  end
1213
1213
  it "should sort by number of Tweets" do
1214
1214
  @cli.followers
1215
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1215
+ $stdout.string.rstrip.should == "sferik pengwynn"
1216
1216
  end
1217
1217
  end
1218
1218
  context "--unsorted" do
@@ -1221,7 +1221,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1221
1221
  end
1222
1222
  it "should not be sorted" do
1223
1223
  @cli.followers
1224
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1224
+ $stdout.string.rstrip.should == "sferik pengwynn"
1225
1225
  end
1226
1226
  end
1227
1227
  context "with a user passed" do
@@ -1288,7 +1288,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1288
1288
  end
1289
1289
  it "should have the correct output" do
1290
1290
  @cli.friends
1291
- $stdout.string.rstrip.should == "@pengwynn @sferik"
1291
+ $stdout.string.rstrip.should == "pengwynn sferik"
1292
1292
  end
1293
1293
  context "--csv" do
1294
1294
  before do
@@ -1309,7 +1309,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
1309
1309
  end
1310
1310
  it "should sort by number of favorites" do
1311
1311
  @cli.friends
1312
- $stdout.string.rstrip.should == "@pengwynn @sferik"
1312
+ $stdout.string.rstrip.should == "pengwynn sferik"
1313
1313
  end
1314
1314
  end
1315
1315
  context "--followers" do
@@ -1318,7 +1318,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
1318
1318
  end
1319
1319
  it "should sort by number of followers" do
1320
1320
  @cli.friends
1321
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1321
+ $stdout.string.rstrip.should == "sferik pengwynn"
1322
1322
  end
1323
1323
  end
1324
1324
  context "--friends" do
@@ -1327,7 +1327,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
1327
1327
  end
1328
1328
  it "should sort by number of friends" do
1329
1329
  @cli.friends
1330
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1330
+ $stdout.string.rstrip.should == "sferik pengwynn"
1331
1331
  end
1332
1332
  end
1333
1333
  context "--listed" do
@@ -1336,7 +1336,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
1336
1336
  end
1337
1337
  it "should sort by number of list memberships" do
1338
1338
  @cli.friends
1339
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1339
+ $stdout.string.rstrip.should == "sferik pengwynn"
1340
1340
  end
1341
1341
  end
1342
1342
  context "--long" do
@@ -1358,7 +1358,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1358
1358
  end
1359
1359
  it "should sort by the time when Twitter acount was created" do
1360
1360
  @cli.friends
1361
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1361
+ $stdout.string.rstrip.should == "sferik pengwynn"
1362
1362
  end
1363
1363
  end
1364
1364
  context "--reverse" do
@@ -1367,7 +1367,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1367
1367
  end
1368
1368
  it "should reverse the order of the sort" do
1369
1369
  @cli.friends
1370
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1370
+ $stdout.string.rstrip.should == "sferik pengwynn"
1371
1371
  end
1372
1372
  end
1373
1373
  context "--tweets" do
@@ -1376,7 +1376,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1376
1376
  end
1377
1377
  it "should sort by number of Tweets" do
1378
1378
  @cli.friends
1379
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1379
+ $stdout.string.rstrip.should == "sferik pengwynn"
1380
1380
  end
1381
1381
  end
1382
1382
  context "--unsorted" do
@@ -1385,7 +1385,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1385
1385
  end
1386
1386
  it "should not be sorted" do
1387
1387
  @cli.friends
1388
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1388
+ $stdout.string.rstrip.should == "sferik pengwynn"
1389
1389
  end
1390
1390
  end
1391
1391
  context "with a user passed" do
@@ -1461,7 +1461,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1461
1461
  end
1462
1462
  it "should have the correct output" do
1463
1463
  @cli.leaders
1464
- $stdout.string.rstrip.should == "@pengwynn @sferik"
1464
+ $stdout.string.rstrip.should == "pengwynn sferik"
1465
1465
  end
1466
1466
  context "--csv" do
1467
1467
  before do
@@ -1482,7 +1482,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
1482
1482
  end
1483
1483
  it "should sort by number of favorites" do
1484
1484
  @cli.leaders
1485
- $stdout.string.rstrip.should == "@pengwynn @sferik"
1485
+ $stdout.string.rstrip.should == "pengwynn sferik"
1486
1486
  end
1487
1487
  end
1488
1488
  context "--followers" do
@@ -1491,7 +1491,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
1491
1491
  end
1492
1492
  it "should sort by number of followers" do
1493
1493
  @cli.leaders
1494
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1494
+ $stdout.string.rstrip.should == "sferik pengwynn"
1495
1495
  end
1496
1496
  end
1497
1497
  context "--friends" do
@@ -1500,7 +1500,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
1500
1500
  end
1501
1501
  it "should sort by number of friends" do
1502
1502
  @cli.leaders
1503
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1503
+ $stdout.string.rstrip.should == "sferik pengwynn"
1504
1504
  end
1505
1505
  end
1506
1506
  context "--listed" do
@@ -1509,7 +1509,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
1509
1509
  end
1510
1510
  it "should sort by number of list memberships" do
1511
1511
  @cli.leaders
1512
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1512
+ $stdout.string.rstrip.should == "sferik pengwynn"
1513
1513
  end
1514
1514
  end
1515
1515
  context "--long" do
@@ -1531,7 +1531,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1531
1531
  end
1532
1532
  it "should sort by the time when Twitter acount was created" do
1533
1533
  @cli.leaders
1534
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1534
+ $stdout.string.rstrip.should == "sferik pengwynn"
1535
1535
  end
1536
1536
  end
1537
1537
  context "--reverse" do
@@ -1540,7 +1540,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1540
1540
  end
1541
1541
  it "should reverse the order of the sort" do
1542
1542
  @cli.leaders
1543
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1543
+ $stdout.string.rstrip.should == "sferik pengwynn"
1544
1544
  end
1545
1545
  end
1546
1546
  context "--tweets" do
@@ -1549,7 +1549,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1549
1549
  end
1550
1550
  it "should sort by number of Tweets" do
1551
1551
  @cli.leaders
1552
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1552
+ $stdout.string.rstrip.should == "sferik pengwynn"
1553
1553
  end
1554
1554
  end
1555
1555
  context "--unsorted" do
@@ -1558,7 +1558,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
1558
1558
  end
1559
1559
  it "should not be sorted" do
1560
1560
  @cli.leaders
1561
- $stdout.string.rstrip.should == "@sferik @pengwynn"
1561
+ $stdout.string.rstrip.should == "sferik pengwynn"
1562
1562
  end
1563
1563
  end
1564
1564
  context "with a user passed" do
@@ -1911,6 +1911,38 @@ ID Posted at Screen name Text
1911
1911
  end
1912
1912
  end
1913
1913
 
1914
+ describe "#rate_limit" do
1915
+ before do
1916
+ stub_get("/1/account/rate_limit_status.json").
1917
+ to_return(:body => fixture("rate_limit_status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
1918
+ end
1919
+ it "should request the correct resource" do
1920
+ @cli.rate_limit
1921
+ a_get("/1/account/rate_limit_status.json").
1922
+ should have_been_made
1923
+ end
1924
+ it "should have the correct output" do
1925
+ @cli.rate_limit
1926
+ $stdout.string.should == <<-eos
1927
+ Hourly limit 20,000
1928
+ Remaining hits 19,993
1929
+ Reset time Oct 25 2010
1930
+ eos
1931
+ end
1932
+ context "--csv" do
1933
+ before do
1934
+ @cli.options = @cli.options.merge("csv" => true)
1935
+ end
1936
+ it "should have the correct output" do
1937
+ @cli.rate_limit
1938
+ $stdout.string.should == <<-eos
1939
+ Hourly limit,Remaining hits,Reset time
1940
+ 20000,19993,2010-10-26 02:43:08 +0000
1941
+ eos
1942
+ end
1943
+ end
1944
+ end
1945
+
1914
1946
  describe "#reply" do
1915
1947
  before do
1916
1948
  @cli.options = @cli.options.merge("profile" => fixture_path + "/.trc", "location" => true)
@@ -2206,6 +2238,7 @@ ID 55709764298092545
2206
2238
  Text The problem with your code is that it's doing exactly what you told it to do.
2207
2239
  Screen name @sferik
2208
2240
  Posted at Apr 6 2011
2241
+ Location Blowfish Sushi To Die For, 2170 Bryant St, San Francisco, California, United States
2209
2242
  Retweets 320
2210
2243
  Source Twitter for iPhone
2211
2244
  URL https://twitter.com/sferik/status/55709764298092545
@@ -2219,7 +2252,107 @@ URL https://twitter.com/sferik/status/55709764298092545
2219
2252
  @cli.status("55709764298092545")
2220
2253
  $stdout.string.should == <<-eos
2221
2254
  ID,Text,Screen name,Posted at,Location,Retweets,Source,URL
2222
- 55709764298092545,The problem with your code is that it's doing exactly what you told it to do.,sferik,2011-04-06 19:13:37 +0000,,320,Twitter for iPhone,https://twitter.com/sferik/status/55709764298092545
2255
+ 55709764298092545,The problem with your code is that it's doing exactly what you told it to do.,sferik,2011-04-06 19:13:37 +0000,"Blowfish Sushi To Die For, 2170 Bryant St, San Francisco, California, United States",320,Twitter for iPhone,https://twitter.com/sferik/status/55709764298092545
2256
+ eos
2257
+ end
2258
+ end
2259
+ context "with no street address" do
2260
+ before do
2261
+ stub_get("/1/statuses/show/55709764298092545.json").
2262
+ with(:query => {:include_my_retweet => "false"}).
2263
+ to_return(:body => fixture("status_no_street_address.json"), :headers => {:content_type => "application/json; charset=utf-8"})
2264
+ end
2265
+ it "should have the correct output" do
2266
+ @cli.status("55709764298092545")
2267
+ $stdout.string.should == <<-eos
2268
+ ID 55709764298092545
2269
+ Text The problem with your code is that it's doing exactly what you told it to do.
2270
+ Screen name @sferik
2271
+ Posted at Apr 6 2011
2272
+ Location Blowfish Sushi To Die For, San Francisco, California, United States
2273
+ Retweets 320
2274
+ Source Twitter for iPhone
2275
+ URL https://twitter.com/sferik/status/55709764298092545
2276
+ eos
2277
+ end
2278
+ end
2279
+ context "with no locality" do
2280
+ before do
2281
+ stub_get("/1/statuses/show/55709764298092545.json").
2282
+ with(:query => {:include_my_retweet => "false"}).
2283
+ to_return(:body => fixture("status_no_locality.json"), :headers => {:content_type => "application/json; charset=utf-8"})
2284
+ end
2285
+ it "should have the correct output" do
2286
+ @cli.status("55709764298092545")
2287
+ $stdout.string.should == <<-eos
2288
+ ID 55709764298092545
2289
+ Text The problem with your code is that it's doing exactly what you told it to do.
2290
+ Screen name @sferik
2291
+ Posted at Apr 6 2011
2292
+ Location Blowfish Sushi To Die For, San Francisco, California, United States
2293
+ Retweets 320
2294
+ Source Twitter for iPhone
2295
+ URL https://twitter.com/sferik/status/55709764298092545
2296
+ eos
2297
+ end
2298
+ end
2299
+ context "with no attributes" do
2300
+ before do
2301
+ stub_get("/1/statuses/show/55709764298092545.json").
2302
+ with(:query => {:include_my_retweet => "false"}).
2303
+ to_return(:body => fixture("status_no_attributes.json"), :headers => {:content_type => "application/json; charset=utf-8"})
2304
+ end
2305
+ it "should have the correct output" do
2306
+ @cli.status("55709764298092545")
2307
+ $stdout.string.should == <<-eos
2308
+ ID 55709764298092545
2309
+ Text The problem with your code is that it's doing exactly what you told it to do.
2310
+ Screen name @sferik
2311
+ Posted at Apr 6 2011
2312
+ Location Blowfish Sushi To Die For, San Francisco, United States
2313
+ Retweets 320
2314
+ Source Twitter for iPhone
2315
+ URL https://twitter.com/sferik/status/55709764298092545
2316
+ eos
2317
+ end
2318
+ end
2319
+ context "with no country" do
2320
+ before do
2321
+ stub_get("/1/statuses/show/55709764298092545.json").
2322
+ with(:query => {:include_my_retweet => "false"}).
2323
+ to_return(:body => fixture("status_no_country.json"), :headers => {:content_type => "application/json; charset=utf-8"})
2324
+ end
2325
+ it "should have the correct output" do
2326
+ @cli.status("55709764298092545")
2327
+ $stdout.string.should == <<-eos
2328
+ ID 55709764298092545
2329
+ Text The problem with your code is that it's doing exactly what you told it to do.
2330
+ Screen name @sferik
2331
+ Posted at Apr 6 2011
2332
+ Location Blowfish Sushi To Die For, San Francisco
2333
+ Retweets 320
2334
+ Source Twitter for iPhone
2335
+ URL https://twitter.com/sferik/status/55709764298092545
2336
+ eos
2337
+ end
2338
+ end
2339
+ context "with no full name" do
2340
+ before do
2341
+ stub_get("/1/statuses/show/55709764298092545.json").
2342
+ with(:query => {:include_my_retweet => "false"}).
2343
+ to_return(:body => fixture("status_no_full_name.json"), :headers => {:content_type => "application/json; charset=utf-8"})
2344
+ end
2345
+ it "should have the correct output" do
2346
+ @cli.status("55709764298092545")
2347
+ $stdout.string.should == <<-eos
2348
+ ID 55709764298092545
2349
+ Text The problem with your code is that it's doing exactly what you told it to do.
2350
+ Screen name @sferik
2351
+ Posted at Apr 6 2011
2352
+ Location Blowfish Sushi To Die For
2353
+ Retweets 320
2354
+ Source Twitter for iPhone
2355
+ URL https://twitter.com/sferik/status/55709764298092545
2223
2356
  eos
2224
2357
  end
2225
2358
  end
@@ -2243,7 +2376,7 @@ ID,Text,Screen name,Posted at,Location,Retweets,Source,URL
2243
2376
  end
2244
2377
  it "should have the correct output" do
2245
2378
  @cli.suggest
2246
- $stdout.string.rstrip.should == "@antpires @jtrupiano @maccman @mlroach @stuntmann82"
2379
+ $stdout.string.rstrip.should == "antpires jtrupiano maccman mlroach stuntmann82"
2247
2380
  end
2248
2381
  context "--csv" do
2249
2382
  before do
@@ -2267,7 +2400,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
2267
2400
  end
2268
2401
  it "should sort by number of favorites" do
2269
2402
  @cli.suggest
2270
- $stdout.string.rstrip.should == "@stuntmann82 @antpires @maccman @mlroach @jtrupiano"
2403
+ $stdout.string.rstrip.should == "stuntmann82 antpires maccman mlroach jtrupiano"
2271
2404
  end
2272
2405
  end
2273
2406
  context "--followers" do
@@ -2276,7 +2409,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
2276
2409
  end
2277
2410
  it "should sort by number of followers" do
2278
2411
  @cli.suggest
2279
- $stdout.string.rstrip.should == "@stuntmann82 @antpires @mlroach @jtrupiano @maccman"
2412
+ $stdout.string.rstrip.should == "stuntmann82 antpires mlroach jtrupiano maccman"
2280
2413
  end
2281
2414
  end
2282
2415
  context "--friends" do
@@ -2285,7 +2418,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
2285
2418
  end
2286
2419
  it "should sort by number of friends" do
2287
2420
  @cli.suggest
2288
- $stdout.string.rstrip.should == "@stuntmann82 @antpires @mlroach @jtrupiano @maccman"
2421
+ $stdout.string.rstrip.should == "stuntmann82 antpires mlroach jtrupiano maccman"
2289
2422
  end
2290
2423
  end
2291
2424
  context "--listed" do
@@ -2294,7 +2427,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
2294
2427
  end
2295
2428
  it "should sort by number of list memberships" do
2296
2429
  @cli.suggest
2297
- $stdout.string.rstrip.should == "@stuntmann82 @antpires @mlroach @jtrupiano @maccman"
2430
+ $stdout.string.rstrip.should == "stuntmann82 antpires mlroach jtrupiano maccman"
2298
2431
  end
2299
2432
  end
2300
2433
  context "--long" do
@@ -2333,7 +2466,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
2333
2466
  end
2334
2467
  it "should sort by the time when Twitter acount was created" do
2335
2468
  @cli.suggest
2336
- $stdout.string.rstrip.should == "@maccman @mlroach @jtrupiano @stuntmann82 @antpires"
2469
+ $stdout.string.rstrip.should == "maccman mlroach jtrupiano stuntmann82 antpires"
2337
2470
  end
2338
2471
  end
2339
2472
  context "--reverse" do
@@ -2342,7 +2475,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
2342
2475
  end
2343
2476
  it "should reverse the order of the sort" do
2344
2477
  @cli.suggest
2345
- $stdout.string.rstrip.should == "@stuntmann82 @mlroach @maccman @jtrupiano @antpires"
2478
+ $stdout.string.rstrip.should == "stuntmann82 mlroach maccman jtrupiano antpires"
2346
2479
  end
2347
2480
  end
2348
2481
  context "--tweets" do
@@ -2351,7 +2484,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
2351
2484
  end
2352
2485
  it "should sort by number of Tweets" do
2353
2486
  @cli.suggest
2354
- $stdout.string.rstrip.should == "@stuntmann82 @antpires @jtrupiano @maccman @mlroach"
2487
+ $stdout.string.rstrip.should == "stuntmann82 antpires jtrupiano maccman mlroach"
2355
2488
  end
2356
2489
  end
2357
2490
  context "--unsorted" do
@@ -2360,7 +2493,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
2360
2493
  end
2361
2494
  it "should not be sorted" do
2362
2495
  @cli.suggest
2363
- $stdout.string.rstrip.should == "@jtrupiano @mlroach @antpires @maccman @stuntmann82"
2496
+ $stdout.string.rstrip.should == "jtrupiano mlroach antpires maccman stuntmann82"
2364
2497
  end
2365
2498
  end
2366
2499
  context "with a user passed" do
@@ -2372,7 +2505,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
2372
2505
  end
2373
2506
  it "should have the correct output" do
2374
2507
  @cli.suggest("sferik")
2375
- $stdout.string.rstrip.should == "@antpires @jtrupiano @maccman @mlroach @stuntmann82"
2508
+ $stdout.string.rstrip.should == "antpires jtrupiano maccman mlroach stuntmann82"
2376
2509
  end
2377
2510
  context "--id" do
2378
2511
  before do
@@ -2791,7 +2924,7 @@ WOEID Parent ID Type Name Country
2791
2924
  end
2792
2925
  it "should have the correct output" do
2793
2926
  @cli.users("sferik", "pengwynn")
2794
- $stdout.string.rstrip.should == "@pengwynn @sferik"
2927
+ $stdout.string.rstrip.should == "pengwynn sferik"
2795
2928
  end
2796
2929
  context "--csv" do
2797
2930
  before do
@@ -2812,7 +2945,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
2812
2945
  end
2813
2946
  it "should sort by number of favorites" do
2814
2947
  @cli.users("sferik", "pengwynn")
2815
- $stdout.string.rstrip.should == "@pengwynn @sferik"
2948
+ $stdout.string.rstrip.should == "pengwynn sferik"
2816
2949
  end
2817
2950
  end
2818
2951
  context "--followers" do
@@ -2821,7 +2954,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
2821
2954
  end
2822
2955
  it "should sort by number of followers" do
2823
2956
  @cli.users("sferik", "pengwynn")
2824
- $stdout.string.rstrip.should == "@sferik @pengwynn"
2957
+ $stdout.string.rstrip.should == "sferik pengwynn"
2825
2958
  end
2826
2959
  end
2827
2960
  context "--friends" do
@@ -2830,7 +2963,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
2830
2963
  end
2831
2964
  it "should sort by number of friends" do
2832
2965
  @cli.users("sferik", "pengwynn")
2833
- $stdout.string.rstrip.should == "@sferik @pengwynn"
2966
+ $stdout.string.rstrip.should == "sferik pengwynn"
2834
2967
  end
2835
2968
  end
2836
2969
  context "--id" do
@@ -2853,7 +2986,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
2853
2986
  end
2854
2987
  it "should sort by number of list memberships" do
2855
2988
  @cli.users("sferik", "pengwynn")
2856
- $stdout.string.rstrip.should == "@sferik @pengwynn"
2989
+ $stdout.string.rstrip.should == "sferik pengwynn"
2857
2990
  end
2858
2991
  end
2859
2992
  context "--long" do
@@ -2875,7 +3008,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
2875
3008
  end
2876
3009
  it "should sort by the time when Twitter acount was created" do
2877
3010
  @cli.users("sferik", "pengwynn")
2878
- $stdout.string.rstrip.should == "@sferik @pengwynn"
3011
+ $stdout.string.rstrip.should == "sferik pengwynn"
2879
3012
  end
2880
3013
  end
2881
3014
  context "--reverse" do
@@ -2884,7 +3017,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
2884
3017
  end
2885
3018
  it "should reverse the order of the sort" do
2886
3019
  @cli.users("sferik", "pengwynn")
2887
- $stdout.string.rstrip.should == "@sferik @pengwynn"
3020
+ $stdout.string.rstrip.should == "sferik pengwynn"
2888
3021
  end
2889
3022
  end
2890
3023
  context "--tweets" do
@@ -2893,7 +3026,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
2893
3026
  end
2894
3027
  it "should sort by number of Tweets" do
2895
3028
  @cli.users("sferik", "pengwynn")
2896
- $stdout.string.rstrip.should == "@sferik @pengwynn"
3029
+ $stdout.string.rstrip.should == "sferik pengwynn"
2897
3030
  end
2898
3031
  end
2899
3032
  context "--unsorted" do
@@ -2902,7 +3035,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
2902
3035
  end
2903
3036
  it "should not be sorted" do
2904
3037
  @cli.users("sferik", "pengwynn")
2905
- $stdout.string.rstrip.should == "@sferik @pengwynn"
3038
+ $stdout.string.rstrip.should == "sferik pengwynn"
2906
3039
  end
2907
3040
  end
2908
3041
  end