t 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +28 -18
- data/lib/t/cli.rb +167 -166
- data/lib/t/delete.rb +12 -12
- data/lib/t/list.rb +26 -26
- data/lib/t/printable.rb +12 -2
- data/lib/t/rcfile.rb +11 -11
- data/lib/t/requestable.rb +5 -5
- data/lib/t/search.rb +14 -14
- data/lib/t/set.rb +15 -14
- data/lib/t/version.rb +1 -1
- data/spec/cli_spec.rb +154 -150
- data/spec/delete_spec.rb +11 -11
- data/spec/list_spec.rb +25 -24
- data/spec/rcfile_spec.rb +29 -15
- data/spec/search_spec.rb +19 -14
- data/spec/set_spec.rb +15 -15
- data/t.gemspec +1 -1
- metadata +3 -3
data/lib/t/delete.rb
CHANGED
@@ -16,8 +16,8 @@ module T
|
|
16
16
|
end
|
17
17
|
|
18
18
|
desc "block USER [USER...]", "Unblock users."
|
19
|
-
method_option
|
20
|
-
method_option
|
19
|
+
method_option "id", :aliases => "-i", :type => "boolean", :default => false, :desc => "Specify input as Twitter user IDs instead of screen names."
|
20
|
+
method_option "force", :aliases => "-f", :type => :boolean, :default => false
|
21
21
|
def block(user, *users)
|
22
22
|
users.unshift(user)
|
23
23
|
if options['id']
|
@@ -31,13 +31,13 @@ module T
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
number = users.length
|
34
|
-
say "@#{@rcfile.
|
34
|
+
say "@#{@rcfile.active_profile[0]} unblocked #{number} #{number == 1 ? 'user' : 'users'}."
|
35
35
|
say
|
36
36
|
say "Run `#{File.basename($0)} block #{users.map{|user| "@#{user.screen_name}"}.join(' ')}` to block."
|
37
37
|
end
|
38
38
|
|
39
39
|
desc "dm [DIRECT_MESSAGE_ID] [DIRECT_MESSAGE_ID...]", "Delete the last Direct Message sent."
|
40
|
-
method_option
|
40
|
+
method_option "force", :aliases => "-f", :type => :boolean, :default => false
|
41
41
|
def dm(direct_message_id, *direct_message_ids)
|
42
42
|
direct_message_ids.unshift(direct_message_id)
|
43
43
|
direct_message_ids.map!(&:strip_commas)
|
@@ -47,13 +47,13 @@ module T
|
|
47
47
|
return unless yes? "Are you sure you want to permanently delete the direct message to @#{direct_message.recipient.screen_name}: \"#{direct_message.text}\"? [y/N]"
|
48
48
|
end
|
49
49
|
direct_message = client.direct_message_destroy(direct_message_id.to_i, :include_entities => false)
|
50
|
-
say "@#{@rcfile.
|
50
|
+
say "@#{@rcfile.active_profile[0]} deleted the direct message sent to @#{direct_message.recipient.screen_name}: \"#{direct_message.text}\""
|
51
51
|
end
|
52
52
|
end
|
53
53
|
map %w(d m) => :dm
|
54
54
|
|
55
55
|
desc "favorite STATUS_ID [STATUS_ID...]", "Delete favorites."
|
56
|
-
method_option
|
56
|
+
method_option "force", :aliases => "-f", :type => :boolean, :default => false
|
57
57
|
def favorite(status_id, *status_ids)
|
58
58
|
status_ids.unshift(status_id)
|
59
59
|
status_ids.map!(&:strip_commas)
|
@@ -63,14 +63,14 @@ module T
|
|
63
63
|
return unless yes? "Are you sure you want to remove @#{status.user.screen_name}'s status: \"#{status.text}\" from your favorites? [y/N]"
|
64
64
|
end
|
65
65
|
status = client.unfavorite(status_id.to_i, :include_entities => false)
|
66
|
-
say "@#{@rcfile.
|
66
|
+
say "@#{@rcfile.active_profile[0]} unfavorited @#{status.user.screen_name}'s status: \"#{status.text}\""
|
67
67
|
end
|
68
68
|
end
|
69
69
|
map %w(fave favourite) => :favorite
|
70
70
|
|
71
71
|
desc "list LIST", "Delete a list."
|
72
|
-
method_option
|
73
|
-
method_option
|
72
|
+
method_option "force", :aliases => "-f", :type => :boolean, :default => false
|
73
|
+
method_option "id", :aliases => "-i", :type => "boolean", :default => false, :desc => "Specify list via ID instead of slug."
|
74
74
|
def list(list)
|
75
75
|
list = list.to_i if options['id']
|
76
76
|
list = client.list(list)
|
@@ -78,11 +78,11 @@ module T
|
|
78
78
|
return unless yes? "Are you sure you want to permanently delete the list \"#{list.name}\"? [y/N]"
|
79
79
|
end
|
80
80
|
list = client.list_destroy(list.id)
|
81
|
-
say "@#{@rcfile.
|
81
|
+
say "@#{@rcfile.active_profile[0]} deleted the list \"#{list.name}\"."
|
82
82
|
end
|
83
83
|
|
84
84
|
desc "status STATUS_ID [STATUS_ID...]", "Delete Tweets."
|
85
|
-
method_option
|
85
|
+
method_option "force", :aliases => "-f", :type => :boolean, :default => false
|
86
86
|
def status(status_id, *status_ids)
|
87
87
|
status_ids.unshift(status_id)
|
88
88
|
status_ids.map!(&:strip_commas)
|
@@ -92,7 +92,7 @@ module T
|
|
92
92
|
return unless yes? "Are you sure you want to permanently delete @#{status.user.screen_name}'s status: \"#{status.text}\"? [y/N]"
|
93
93
|
end
|
94
94
|
status = client.status_destroy(status_id.to_i, :include_entities => false, :trim_user => true)
|
95
|
-
say "@#{@rcfile.
|
95
|
+
say "@#{@rcfile.active_profile[0]} deleted the status: \"#{status.text}\""
|
96
96
|
end
|
97
97
|
end
|
98
98
|
map %w(post tweet update) => :status
|
data/lib/t/list.rb
CHANGED
@@ -32,7 +32,7 @@ module T
|
|
32
32
|
end
|
33
33
|
|
34
34
|
desc "add LIST USER [USER...]", "Add members to a list."
|
35
|
-
method_option
|
35
|
+
method_option "id", :aliases => "-i", :type => "boolean", :default => false, :desc => "Specify input as Twitter user IDs instead of screen names."
|
36
36
|
def add(list, user, *users)
|
37
37
|
users.unshift(user)
|
38
38
|
if options['id']
|
@@ -46,7 +46,7 @@ module T
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
number = users.length
|
49
|
-
say "@#{@rcfile.
|
49
|
+
say "@#{@rcfile.active_profile[0]} added #{number} #{number == 1 ? 'member' : 'members'} to the list \"#{list}\"."
|
50
50
|
say
|
51
51
|
if options['id']
|
52
52
|
say "Run `#{File.basename($0)} list remove --id #{list} #{users.join(' ')}` to undo."
|
@@ -56,21 +56,21 @@ module T
|
|
56
56
|
end
|
57
57
|
|
58
58
|
desc "create LIST [DESCRIPTION]", "Create a new list."
|
59
|
-
method_option
|
59
|
+
method_option "private", :aliases => "-p", :type => :boolean
|
60
60
|
def create(list, description="")
|
61
61
|
opts = description.blank? ? {} : {:description => description}
|
62
62
|
opts.merge!(:mode => 'private') if options['private']
|
63
63
|
client.list_create(list, opts)
|
64
|
-
say "@#{@rcfile.
|
64
|
+
say "@#{@rcfile.active_profile[0]} created the list \"#{list}\"."
|
65
65
|
end
|
66
66
|
|
67
67
|
desc "information [USER/]LIST", "Retrieves detailed information about a Twitter list."
|
68
|
-
method_option
|
68
|
+
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
69
69
|
def information(list)
|
70
70
|
owner, list = list.split('/')
|
71
71
|
if list.nil?
|
72
72
|
list = owner
|
73
|
-
owner = @rcfile.
|
73
|
+
owner = @rcfile.active_profile[0]
|
74
74
|
else
|
75
75
|
owner = if options['id']
|
76
76
|
owner.to_i
|
@@ -102,22 +102,22 @@ module T
|
|
102
102
|
map %w(detail) => :information
|
103
103
|
|
104
104
|
desc "members [USER/]LIST", "Returns the members of a Twitter list."
|
105
|
-
method_option
|
106
|
-
method_option
|
107
|
-
method_option
|
108
|
-
method_option
|
109
|
-
method_option
|
110
|
-
method_option
|
111
|
-
method_option
|
112
|
-
method_option
|
113
|
-
method_option
|
114
|
-
method_option
|
115
|
-
method_option
|
105
|
+
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
106
|
+
method_option "followers", :aliases => "-v", :type => :boolean, :default => false, :desc => "Sort by total number of favorites."
|
107
|
+
method_option "followers", :aliases => "-f", :type => :boolean, :default => false, :desc => "Sort by total number of followers."
|
108
|
+
method_option "friends", :aliases => "-e", :type => :boolean, :default => false, :desc => "Sort by total number of friends."
|
109
|
+
method_option "id", :aliases => "-i", :type => "boolean", :default => false, :desc => "Specify user via ID instead of screen name."
|
110
|
+
method_option "listed", :aliases => "-s", :type => :boolean, :default => false, :desc => "Sort by number of list memberships."
|
111
|
+
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
112
|
+
method_option "posted", :aliases => "-p", :type => :boolean, :default => false, :desc => "Sort by the time when Twitter account was posted."
|
113
|
+
method_option "reverse", :aliases => "-r", :type => :boolean, :default => false, :desc => "Reverse the order of the sort."
|
114
|
+
method_option "tweets", :aliases => "-t", :type => :boolean, :default => false, :desc => "Sort by total number of Tweets."
|
115
|
+
method_option "unsorted", :aliases => "-u", :type => :boolean, :default => false, :desc => "Output is not sorted."
|
116
116
|
def members(list)
|
117
117
|
owner, list = list.split('/')
|
118
118
|
if list.nil?
|
119
119
|
list = owner
|
120
|
-
owner = @rcfile.
|
120
|
+
owner = @rcfile.active_profile[0]
|
121
121
|
else
|
122
122
|
owner = if options['id']
|
123
123
|
owner.to_i
|
@@ -132,7 +132,7 @@ module T
|
|
132
132
|
end
|
133
133
|
|
134
134
|
desc "remove LIST USER [USER...]", "Remove members from a list."
|
135
|
-
method_option
|
135
|
+
method_option "id", :aliases => "-i", :type => "boolean", :default => false, :desc => "Specify input as Twitter user IDs instead of screen names."
|
136
136
|
def remove(list, user, *users)
|
137
137
|
users.unshift(user)
|
138
138
|
if options['id']
|
@@ -146,7 +146,7 @@ module T
|
|
146
146
|
end
|
147
147
|
end
|
148
148
|
number = users.length
|
149
|
-
say "@#{@rcfile.
|
149
|
+
say "@#{@rcfile.active_profile[0]} removed #{number} #{number == 1 ? 'member' : 'members'} from the list \"#{list}\"."
|
150
150
|
say
|
151
151
|
if options['id']
|
152
152
|
say "Run `#{File.basename($0)} list add --id #{list} #{users.join(' ')}` to undo."
|
@@ -156,16 +156,16 @@ module T
|
|
156
156
|
end
|
157
157
|
|
158
158
|
desc "timeline [USER/]LIST", "Show tweet timeline for members of the specified list."
|
159
|
-
method_option
|
160
|
-
method_option
|
161
|
-
method_option
|
162
|
-
method_option
|
163
|
-
method_option
|
159
|
+
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
160
|
+
method_option "id", :aliases => "-i", :type => "boolean", :default => false, :desc => "Specify user via ID instead of screen name."
|
161
|
+
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
162
|
+
method_option "number", :aliases => "-n", :type => :numeric, :default => DEFAULT_NUM_RESULTS, :desc => "Limit the number of results."
|
163
|
+
method_option "reverse", :aliases => "-r", :type => :boolean, :default => false, :desc => "Reverse the order of the sort."
|
164
164
|
def timeline(list)
|
165
165
|
owner, list = list.split('/')
|
166
166
|
if list.nil?
|
167
167
|
list = owner
|
168
|
-
owner = @rcfile.
|
168
|
+
owner = @rcfile.active_profile[0]
|
169
169
|
else
|
170
170
|
owner = if options['id']
|
171
171
|
owner.to_i
|
data/lib/t/printable.rb
CHANGED
@@ -3,6 +3,7 @@ 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 'highline'
|
6
|
+
require 'thor/shell/color'
|
6
7
|
|
7
8
|
module T
|
8
9
|
module Printable
|
@@ -79,8 +80,17 @@ module T
|
|
79
80
|
end
|
80
81
|
print_table(array)
|
81
82
|
else
|
82
|
-
|
83
|
-
|
83
|
+
if STDOUT.tty? && !options['no-color']
|
84
|
+
statuses.each do |status|
|
85
|
+
say(" #{Thor::Shell::Color::BOLD}#{status.user.screen_name}", :yellow)
|
86
|
+
Thor::Shell::Basic.new.print_wrapped(status.text, :indent => 2)
|
87
|
+
say(" #{Thor::Shell::Color::BOLD}#{time_ago_in_words(status.created_at)} ago", :black)
|
88
|
+
say
|
89
|
+
end
|
90
|
+
else
|
91
|
+
statuses.each do |status|
|
92
|
+
say "#{status.user.screen_name.rjust(MAX_SCREEN_NAME_SIZE)}: #{status.text.gsub(/\n+/, ' ')} (#{time_ago_in_words(status.created_at)} ago)"
|
93
|
+
end
|
84
94
|
end
|
85
95
|
end
|
86
96
|
end
|
data/lib/t/rcfile.rb
CHANGED
@@ -26,29 +26,29 @@ class RCFile
|
|
26
26
|
@data['configuration']
|
27
27
|
end
|
28
28
|
|
29
|
-
def
|
30
|
-
profiles[
|
29
|
+
def active_consumer_key
|
30
|
+
profiles[active_profile[0]][active_profile[1]]['consumer_key'] if active_profile && profiles[active_profile[0]] && profiles[active_profile[0]][active_profile[1]]
|
31
31
|
end
|
32
32
|
|
33
|
-
def
|
34
|
-
profiles[
|
33
|
+
def active_consumer_secret
|
34
|
+
profiles[active_profile[0]][active_profile[1]]['consumer_secret'] if active_profile && profiles[active_profile[0]] && profiles[active_profile[0]][active_profile[1]]
|
35
35
|
end
|
36
36
|
|
37
|
-
def
|
37
|
+
def active_profile
|
38
38
|
configuration['default_profile']
|
39
39
|
end
|
40
40
|
|
41
|
-
def
|
41
|
+
def active_profile=(profile)
|
42
42
|
configuration['default_profile'] = [profile['username'], profile['consumer_key']]
|
43
43
|
write
|
44
44
|
end
|
45
45
|
|
46
|
-
def
|
47
|
-
profiles[
|
46
|
+
def active_secret
|
47
|
+
profiles[active_profile[0]][active_profile[1]]['secret'] if active_profile && profiles[active_profile[0]] && profiles[active_profile[0]][active_profile[1]]
|
48
48
|
end
|
49
49
|
|
50
|
-
def
|
51
|
-
profiles[
|
50
|
+
def active_token
|
51
|
+
profiles[active_profile[0]][active_profile[1]]['token'] if active_profile && profiles[active_profile[0]] && profiles[active_profile[0]][active_profile[1]]
|
52
52
|
end
|
53
53
|
|
54
54
|
def delete
|
@@ -86,7 +86,7 @@ private
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def write
|
89
|
-
File.open(@path,
|
89
|
+
File.open(@path, File::RDWR|File::CREAT, 0600) do |rcfile|
|
90
90
|
rcfile.write @data.to_yaml
|
91
91
|
end
|
92
92
|
end
|
data/lib/t/requestable.rb
CHANGED
@@ -18,10 +18,10 @@ module T
|
|
18
18
|
@rcfile.path = options['profile'] if options['profile']
|
19
19
|
@client = Twitter::Client.new(
|
20
20
|
:endpoint => base_url,
|
21
|
-
:consumer_key => @rcfile.
|
22
|
-
:consumer_secret => @rcfile.
|
23
|
-
:oauth_token => @rcfile.
|
24
|
-
:oauth_token_secret => @rcfile.
|
21
|
+
:consumer_key => @rcfile.active_consumer_key,
|
22
|
+
:consumer_secret => @rcfile.active_consumer_secret,
|
23
|
+
:oauth_token => @rcfile.active_token,
|
24
|
+
:oauth_token_secret => @rcfile.active_secret
|
25
25
|
)
|
26
26
|
end
|
27
27
|
|
@@ -30,7 +30,7 @@ module T
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def protocol
|
33
|
-
options['
|
33
|
+
options['no-ssl'] ? 'http' : DEFAULT_PROTOCOL
|
34
34
|
end
|
35
35
|
|
36
36
|
end
|
data/lib/t/search.rb
CHANGED
@@ -28,9 +28,9 @@ module T
|
|
28
28
|
end
|
29
29
|
|
30
30
|
desc "all QUERY", "Returns the #{DEFAULT_NUM_RESULTS} most recent Tweets that match a specified query."
|
31
|
-
method_option
|
32
|
-
method_option
|
33
|
-
method_option
|
31
|
+
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
32
|
+
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
33
|
+
method_option "number", :aliases => "-n", :type => :numeric, :default => DEFAULT_NUM_RESULTS
|
34
34
|
def all(query)
|
35
35
|
rpp = options['number'] || DEFAULT_NUM_RESULTS
|
36
36
|
statuses = client.search(query, :include_entities => false, :rpp => rpp)
|
@@ -57,8 +57,8 @@ module T
|
|
57
57
|
end
|
58
58
|
|
59
59
|
desc "favorites QUERY", "Returns Tweets you've favorited that mach a specified query."
|
60
|
-
method_option
|
61
|
-
method_option
|
60
|
+
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
61
|
+
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
62
62
|
def favorites(query)
|
63
63
|
statuses = 1.upto(MAX_PAGES).threaded_map do |page|
|
64
64
|
retryable(:tries => 3, :on => Twitter::Error::ServerError, :sleep => 0) do
|
@@ -72,8 +72,8 @@ module T
|
|
72
72
|
map %w(faves) => :favorites
|
73
73
|
|
74
74
|
desc "mentions QUERY", "Returns Tweets mentioning you that mach a specified query."
|
75
|
-
method_option
|
76
|
-
method_option
|
75
|
+
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
76
|
+
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
77
77
|
def mentions(query)
|
78
78
|
statuses = 1.upto(MAX_PAGES).threaded_map do |page|
|
79
79
|
retryable(:tries => 3, :on => Twitter::Error::ServerError, :sleep => 0) do
|
@@ -87,8 +87,8 @@ module T
|
|
87
87
|
map %w(replies) => :mentions
|
88
88
|
|
89
89
|
desc "retweets QUERY", "Returns Tweets you've retweeted that mach a specified query."
|
90
|
-
method_option
|
91
|
-
method_option
|
90
|
+
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
91
|
+
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
92
92
|
def retweets(query)
|
93
93
|
statuses = 1.upto(MAX_PAGES).threaded_map do |page|
|
94
94
|
retryable(:tries => 3, :on => Twitter::Error::ServerError, :sleep => 0) do
|
@@ -102,8 +102,8 @@ module T
|
|
102
102
|
map %w(rts) => :retweets
|
103
103
|
|
104
104
|
desc "timeline QUERY", "Returns Tweets in your timeline that match a specified query."
|
105
|
-
method_option
|
106
|
-
method_option
|
105
|
+
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
106
|
+
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
107
107
|
def timeline(query)
|
108
108
|
statuses = 1.upto(MAX_PAGES).threaded_map do |page|
|
109
109
|
retryable(:tries => 3, :on => Twitter::Error::ServerError, :sleep => 0) do
|
@@ -117,9 +117,9 @@ module T
|
|
117
117
|
map %w(tl) => :timeline
|
118
118
|
|
119
119
|
desc "user USER QUERY", "Returns Tweets in a user's timeline that match a specified query."
|
120
|
-
method_option
|
121
|
-
method_option
|
122
|
-
method_option
|
120
|
+
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
121
|
+
method_option "id", :aliases => "-i", :type => "boolean", :default => false, :desc => "Specify user via ID instead of screen name."
|
122
|
+
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
123
123
|
def user(user, query)
|
124
124
|
user = if options['id']
|
125
125
|
user.to_i
|
data/lib/t/set.rb
CHANGED
@@ -14,43 +14,44 @@ module T
|
|
14
14
|
@rcfile = RCFile.instance
|
15
15
|
end
|
16
16
|
|
17
|
-
desc "
|
18
|
-
def
|
19
|
-
client.update_profile(:description => description, :include_entities => false)
|
20
|
-
say "@#{@rcfile.default_profile[0]}'s bio has been updated."
|
21
|
-
end
|
22
|
-
|
23
|
-
desc "default SCREEN_NAME [CONSUMER_KEY]", "Set your default account."
|
24
|
-
def default(screen_name, consumer_key=nil)
|
17
|
+
desc "active SCREEN_NAME [CONSUMER_KEY]", "Set your active account."
|
18
|
+
def active(screen_name, consumer_key=nil)
|
25
19
|
screen_name = screen_name.strip_ats
|
26
20
|
@rcfile.path = options['profile'] if options['profile']
|
27
21
|
consumer_key = @rcfile[screen_name].keys.last if consumer_key.nil?
|
28
|
-
@rcfile.
|
29
|
-
say "
|
22
|
+
@rcfile.active_profile = {'username' => screen_name, 'consumer_key' => consumer_key}
|
23
|
+
say "Active account has been updated."
|
24
|
+
end
|
25
|
+
map %w(default) => :active
|
26
|
+
|
27
|
+
desc "bio DESCRIPTION", "Edits your Bio information on your Twitter profile."
|
28
|
+
def bio(description)
|
29
|
+
client.update_profile(:description => description, :include_entities => false)
|
30
|
+
say "@#{@rcfile.active_profile[0]}'s bio has been updated."
|
30
31
|
end
|
31
32
|
|
32
33
|
desc "language LANGUAGE_NAME", "Selects the language you'd like to receive notifications in."
|
33
34
|
def language(language_name)
|
34
35
|
client.settings(:lang => language_name)
|
35
|
-
say "@#{@rcfile.
|
36
|
+
say "@#{@rcfile.active_profile[0]}'s language has been updated."
|
36
37
|
end
|
37
38
|
|
38
39
|
desc "location PLACE_NAME", "Updates the location field in your profile."
|
39
40
|
def location(place_name)
|
40
41
|
client.update_profile(:location => place_name, :include_entities => false)
|
41
|
-
say "@#{@rcfile.
|
42
|
+
say "@#{@rcfile.active_profile[0]}'s location has been updated."
|
42
43
|
end
|
43
44
|
|
44
45
|
desc "name NAME", "Sets the name field on your Twitter profile."
|
45
46
|
def name(name)
|
46
47
|
client.update_profile(:name => name, :include_entities => false)
|
47
|
-
say "@#{@rcfile.
|
48
|
+
say "@#{@rcfile.active_profile[0]}'s name has been updated."
|
48
49
|
end
|
49
50
|
|
50
51
|
desc "url URL", "Sets the URL field on your profile."
|
51
52
|
def url(url)
|
52
53
|
client.update_profile(:url => url, :include_entities => false)
|
53
|
-
say "@#{@rcfile.
|
54
|
+
say "@#{@rcfile.active_profile[0]}'s URL has been updated."
|
54
55
|
end
|
55
56
|
|
56
57
|
end
|
data/lib/t/version.rb
CHANGED
data/spec/cli_spec.rb
CHANGED
@@ -22,20 +22,20 @@ describe T::CLI do
|
|
22
22
|
|
23
23
|
describe "#account" do
|
24
24
|
before do
|
25
|
-
@cli.options = @cli.options.merge(
|
25
|
+
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
26
26
|
end
|
27
27
|
it "should have the correct output" do
|
28
28
|
@cli.accounts
|
29
29
|
$stdout.string.should == <<-eos
|
30
30
|
testcli
|
31
|
-
abc123 (
|
31
|
+
abc123 (active)
|
32
32
|
eos
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
describe "#authorize" do
|
37
37
|
before do
|
38
|
-
@cli.options = @cli.options.merge(
|
38
|
+
@cli.options = @cli.options.merge("profile" => project_path + "/tmp/trc", "consumer-key" => "abc123", "consumer-secret" => "asdfasd223sd2", "prompt" => true, "display-url" => true)
|
39
39
|
stub_post("/oauth/request_token").
|
40
40
|
to_return(:body => fixture("request_token"))
|
41
41
|
stub_post("/oauth/access_token").
|
@@ -69,7 +69,7 @@ testcli
|
|
69
69
|
|
70
70
|
describe "#block" do
|
71
71
|
before do
|
72
|
-
@cli.options = @cli.options.merge(
|
72
|
+
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
73
73
|
stub_post("/1/blocks/create.json").
|
74
74
|
with(:body => {:screen_name => "sferik", :include_entities => "false"}).
|
75
75
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -86,7 +86,7 @@ testcli
|
|
86
86
|
end
|
87
87
|
context "--id" do
|
88
88
|
before do
|
89
|
-
@cli.options = @cli.options.merge(
|
89
|
+
@cli.options = @cli.options.merge("id" => true)
|
90
90
|
stub_post("/1/blocks/create.json").
|
91
91
|
with(:body => {:user_id => "7505382", :include_entities => "false"}).
|
92
92
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -129,7 +129,7 @@ testcli
|
|
129
129
|
end
|
130
130
|
context "--csv" do
|
131
131
|
before do
|
132
|
-
@cli.options = @cli.options.merge(
|
132
|
+
@cli.options = @cli.options.merge("csv" => true)
|
133
133
|
end
|
134
134
|
it "should output in CSV format" do
|
135
135
|
@cli.direct_messages
|
@@ -150,7 +150,7 @@ ID,Posted at,Screen name,Text
|
|
150
150
|
end
|
151
151
|
context "--long" do
|
152
152
|
before do
|
153
|
-
@cli.options = @cli.options.merge(
|
153
|
+
@cli.options = @cli.options.merge("long" => true)
|
154
154
|
end
|
155
155
|
it "should output in long format" do
|
156
156
|
@cli.direct_messages
|
@@ -171,7 +171,7 @@ ID Posted at Screen name Text
|
|
171
171
|
end
|
172
172
|
context "--number" do
|
173
173
|
before do
|
174
|
-
@cli.options = @cli.options.merge(
|
174
|
+
@cli.options = @cli.options.merge("number" => 1)
|
175
175
|
stub_get("/1/direct_messages.json").
|
176
176
|
with(:query => {:count => "1", :include_entities => "false"}).
|
177
177
|
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -185,7 +185,7 @@ ID Posted at Screen name Text
|
|
185
185
|
end
|
186
186
|
context "--reverse" do
|
187
187
|
before do
|
188
|
-
@cli.options = @cli.options.merge(
|
188
|
+
@cli.options = @cli.options.merge("reverse" => true)
|
189
189
|
end
|
190
190
|
it "should reverse the order of the sort" do
|
191
191
|
@cli.direct_messages
|
@@ -234,7 +234,7 @@ ID Posted at Screen name Text
|
|
234
234
|
end
|
235
235
|
context "--csv" do
|
236
236
|
before do
|
237
|
-
@cli.options = @cli.options.merge(
|
237
|
+
@cli.options = @cli.options.merge("csv" => true)
|
238
238
|
end
|
239
239
|
it "should output in CSV format" do
|
240
240
|
@cli.direct_messages_sent
|
@@ -255,7 +255,7 @@ ID,Posted at,Screen name,Text
|
|
255
255
|
end
|
256
256
|
context "--long" do
|
257
257
|
before do
|
258
|
-
@cli.options = @cli.options.merge(
|
258
|
+
@cli.options = @cli.options.merge("long" => true)
|
259
259
|
end
|
260
260
|
it "should output in long format" do
|
261
261
|
@cli.direct_messages_sent
|
@@ -276,7 +276,7 @@ ID Posted at Screen name Text
|
|
276
276
|
end
|
277
277
|
context "--number" do
|
278
278
|
before do
|
279
|
-
@cli.options = @cli.options.merge(
|
279
|
+
@cli.options = @cli.options.merge("number" => 1)
|
280
280
|
stub_get("/1/direct_messages/sent.json").
|
281
281
|
with(:query => {:count => "1", :include_entities => "false"}).
|
282
282
|
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -290,7 +290,7 @@ ID Posted at Screen name Text
|
|
290
290
|
end
|
291
291
|
context "--reverse" do
|
292
292
|
before do
|
293
|
-
@cli.options = @cli.options.merge(
|
293
|
+
@cli.options = @cli.options.merge("reverse" => true)
|
294
294
|
end
|
295
295
|
it "should reverse the order of the sort" do
|
296
296
|
@cli.direct_messages_sent
|
@@ -340,7 +340,7 @@ ID Posted at Screen name Text
|
|
340
340
|
end
|
341
341
|
context "--csv" do
|
342
342
|
before do
|
343
|
-
@cli.options = @cli.options.merge(
|
343
|
+
@cli.options = @cli.options.merge("csv" => true)
|
344
344
|
end
|
345
345
|
it "should output in CSV format" do
|
346
346
|
@cli.disciples
|
@@ -353,7 +353,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
353
353
|
end
|
354
354
|
context "--favorites" do
|
355
355
|
before do
|
356
|
-
@cli.options = @cli.options.merge(
|
356
|
+
@cli.options = @cli.options.merge("favorites" => true)
|
357
357
|
end
|
358
358
|
it "should sort by number of favorites" do
|
359
359
|
@cli.disciples
|
@@ -362,7 +362,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
362
362
|
end
|
363
363
|
context "--followers" do
|
364
364
|
before do
|
365
|
-
@cli.options = @cli.options.merge(
|
365
|
+
@cli.options = @cli.options.merge("followers" => true)
|
366
366
|
end
|
367
367
|
it "should sort by number of followers" do
|
368
368
|
@cli.disciples
|
@@ -371,7 +371,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
371
371
|
end
|
372
372
|
context "--friends" do
|
373
373
|
before do
|
374
|
-
@cli.options = @cli.options.merge(
|
374
|
+
@cli.options = @cli.options.merge("friends" => true)
|
375
375
|
end
|
376
376
|
it "should sort by number of friends" do
|
377
377
|
@cli.disciples
|
@@ -380,7 +380,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
380
380
|
end
|
381
381
|
context "--listed" do
|
382
382
|
before do
|
383
|
-
@cli.options = @cli.options.merge(
|
383
|
+
@cli.options = @cli.options.merge("listed" => true)
|
384
384
|
end
|
385
385
|
it "should sort by number of list memberships" do
|
386
386
|
@cli.disciples
|
@@ -389,7 +389,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
389
389
|
end
|
390
390
|
context "--long" do
|
391
391
|
before do
|
392
|
-
@cli.options = @cli.options.merge(
|
392
|
+
@cli.options = @cli.options.merge("long" => true)
|
393
393
|
end
|
394
394
|
it "should output in long format" do
|
395
395
|
@cli.disciples
|
@@ -402,7 +402,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
402
402
|
end
|
403
403
|
context "--posted" do
|
404
404
|
before do
|
405
|
-
@cli.options = @cli.options.merge(
|
405
|
+
@cli.options = @cli.options.merge("posted" => true)
|
406
406
|
end
|
407
407
|
it "should sort by the time when Twitter acount was created" do
|
408
408
|
@cli.disciples
|
@@ -411,7 +411,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
411
411
|
end
|
412
412
|
context "--reverse" do
|
413
413
|
before do
|
414
|
-
@cli.options = @cli.options.merge(
|
414
|
+
@cli.options = @cli.options.merge("reverse" => true)
|
415
415
|
end
|
416
416
|
it "should reverse the order of the sort" do
|
417
417
|
@cli.disciples
|
@@ -420,7 +420,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
420
420
|
end
|
421
421
|
context "--tweets" do
|
422
422
|
before do
|
423
|
-
@cli.options = @cli.options.merge(
|
423
|
+
@cli.options = @cli.options.merge("tweets" => true)
|
424
424
|
end
|
425
425
|
it "should sort by number of Tweets" do
|
426
426
|
@cli.disciples
|
@@ -429,7 +429,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
429
429
|
end
|
430
430
|
context "--unsorted" do
|
431
431
|
before do
|
432
|
-
@cli.options = @cli.options.merge(
|
432
|
+
@cli.options = @cli.options.merge("unsorted" => true)
|
433
433
|
end
|
434
434
|
it "should not be sorted" do
|
435
435
|
@cli.disciples
|
@@ -459,7 +459,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
459
459
|
end
|
460
460
|
context "--id" do
|
461
461
|
before do
|
462
|
-
@cli.options = @cli.options.merge(
|
462
|
+
@cli.options = @cli.options.merge("id" => true)
|
463
463
|
stub_get("/1/followers/ids.json").
|
464
464
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
465
465
|
to_return(:body => fixture("followers_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -485,7 +485,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
485
485
|
|
486
486
|
describe "#dm" do
|
487
487
|
before do
|
488
|
-
@cli.options = @cli.options.merge(
|
488
|
+
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
489
489
|
stub_post("/1/direct_messages/new.json").
|
490
490
|
with(:body => {:screen_name => "pengwynn", :text => "Creating a fixture for the Twitter gem", :include_entities => "false"}).
|
491
491
|
to_return(:body => fixture("direct_message.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -502,7 +502,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
502
502
|
end
|
503
503
|
context "--id" do
|
504
504
|
before do
|
505
|
-
@cli.options = @cli.options.merge(
|
505
|
+
@cli.options = @cli.options.merge("id" => true)
|
506
506
|
stub_post("/1/direct_messages/new.json").
|
507
507
|
with(:body => {:user_id => "14100886", :text => "Creating a fixture for the Twitter gem", :include_entities => "false"}).
|
508
508
|
to_return(:body => fixture("direct_message.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -518,7 +518,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
518
518
|
|
519
519
|
describe "#does_contain" do
|
520
520
|
before do
|
521
|
-
@cli.options = @cli.options.merge(
|
521
|
+
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
522
522
|
stub_get("/1/lists/members/show.json").
|
523
523
|
with(:query => {:owner_screen_name => "testcli", :screen_name => "testcli", :slug => "presidents"}).
|
524
524
|
to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -535,7 +535,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
535
535
|
end
|
536
536
|
context "--id" do
|
537
537
|
before do
|
538
|
-
@cli.options = @cli.options.merge(
|
538
|
+
@cli.options = @cli.options.merge("id" => true)
|
539
539
|
stub_get("/1/users/show.json").
|
540
540
|
with(:query => {:user_id => "7505382", :include_entities => "false"}).
|
541
541
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -560,7 +560,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
560
560
|
end
|
561
561
|
context "--id" do
|
562
562
|
before do
|
563
|
-
@cli.options = @cli.options.merge(
|
563
|
+
@cli.options = @cli.options.merge("id" => true)
|
564
564
|
stub_get("/1/users/show.json").
|
565
565
|
with(:query => {:user_id => "7505382", :include_entities => "false"}).
|
566
566
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -604,7 +604,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
604
604
|
|
605
605
|
describe "#does_follow" do
|
606
606
|
before do
|
607
|
-
@cli.options = @cli.options.merge(
|
607
|
+
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
608
608
|
stub_get("/1/friendships/exists.json").
|
609
609
|
with(:query => {:user_a => "ev", :user_b => "testcli"}).
|
610
610
|
to_return(:body => fixture("true.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -621,7 +621,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
621
621
|
end
|
622
622
|
context "--id" do
|
623
623
|
before do
|
624
|
-
@cli.options = @cli.options.merge(
|
624
|
+
@cli.options = @cli.options.merge("id" => true)
|
625
625
|
stub_get("/1/users/show.json").
|
626
626
|
with(:query => {:user_id => "20", :include_entities => "false"}).
|
627
627
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -646,7 +646,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
646
646
|
end
|
647
647
|
context "--id" do
|
648
648
|
before do
|
649
|
-
@cli.options = @cli.options.merge(
|
649
|
+
@cli.options = @cli.options.merge("id" => true)
|
650
650
|
stub_get("/1/users/show.json").
|
651
651
|
with(:query => {:user_id => "20", :include_entities => "false"}).
|
652
652
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -690,7 +690,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
690
690
|
|
691
691
|
describe "#favorite" do
|
692
692
|
before do
|
693
|
-
@cli.options = @cli.options.merge(
|
693
|
+
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
694
694
|
stub_post("/1/favorites/create/26755176471724032.json").
|
695
695
|
to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
696
696
|
end
|
@@ -707,6 +707,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
707
707
|
|
708
708
|
describe "#favorites" do
|
709
709
|
before do
|
710
|
+
@cli.options = @cli.options.merge("no-color" => true)
|
710
711
|
stub_get("/1/favorites.json").
|
711
712
|
with(:query => {:count => "20", :include_entities => "false"}).
|
712
713
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -741,7 +742,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
741
742
|
end
|
742
743
|
context "--csv" do
|
743
744
|
before do
|
744
|
-
@cli.options = @cli.options.merge(
|
745
|
+
@cli.options = @cli.options.merge("csv" => true)
|
745
746
|
end
|
746
747
|
it "should output in CSV format" do
|
747
748
|
@cli.favorites
|
@@ -769,7 +770,7 @@ ID,Posted at,Screen name,Text
|
|
769
770
|
end
|
770
771
|
context "--long" do
|
771
772
|
before do
|
772
|
-
@cli.options = @cli.options.merge(
|
773
|
+
@cli.options = @cli.options.merge("long" => true)
|
773
774
|
end
|
774
775
|
it "should output in long format" do
|
775
776
|
@cli.favorites
|
@@ -797,7 +798,7 @@ ID Posted at Screen name Text
|
|
797
798
|
end
|
798
799
|
context "--number" do
|
799
800
|
before do
|
800
|
-
@cli.options = @cli.options.merge(
|
801
|
+
@cli.options = @cli.options.merge("number" => 1)
|
801
802
|
stub_get("/1/favorites.json").
|
802
803
|
with(:query => {:count => "1", :include_entities => "false"}).
|
803
804
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -811,7 +812,7 @@ ID Posted at Screen name Text
|
|
811
812
|
end
|
812
813
|
context "--reverse" do
|
813
814
|
before do
|
814
|
-
@cli.options = @cli.options.merge(
|
815
|
+
@cli.options = @cli.options.merge("reverse" => true)
|
815
816
|
end
|
816
817
|
it "should reverse the order of the sort" do
|
817
818
|
@cli.favorites
|
@@ -850,7 +851,7 @@ ID Posted at Screen name Text
|
|
850
851
|
end
|
851
852
|
context "--id" do
|
852
853
|
before do
|
853
|
-
@cli.options = @cli.options.merge(
|
854
|
+
@cli.options = @cli.options.merge("id" => true)
|
854
855
|
stub_get("/1/favorites/7505382.json").
|
855
856
|
with(:query => {:count => "20", :include_entities => "false"}).
|
856
857
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -867,7 +868,7 @@ ID Posted at Screen name Text
|
|
867
868
|
|
868
869
|
describe "#follow" do
|
869
870
|
before do
|
870
|
-
@cli.options = @cli.options.merge(
|
871
|
+
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
871
872
|
end
|
872
873
|
context "one user" do
|
873
874
|
it "should request the correct resource" do
|
@@ -888,7 +889,7 @@ ID Posted at Screen name Text
|
|
888
889
|
end
|
889
890
|
context "--id" do
|
890
891
|
before do
|
891
|
-
@cli.options = @cli.options.merge(
|
892
|
+
@cli.options = @cli.options.merge("id" => true)
|
892
893
|
stub_post("/1/friendships/create.json").
|
893
894
|
with(:body => {:user_id => "7505382", :include_entities => "false"}).
|
894
895
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -940,7 +941,7 @@ ID Posted at Screen name Text
|
|
940
941
|
end
|
941
942
|
context "--csv" do
|
942
943
|
before do
|
943
|
-
@cli.options = @cli.options.merge(
|
944
|
+
@cli.options = @cli.options.merge("csv" => true)
|
944
945
|
end
|
945
946
|
it "should output in CSV format" do
|
946
947
|
@cli.followings
|
@@ -953,7 +954,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
953
954
|
end
|
954
955
|
context "--favorites" do
|
955
956
|
before do
|
956
|
-
@cli.options = @cli.options.merge(
|
957
|
+
@cli.options = @cli.options.merge("favorites" => true)
|
957
958
|
end
|
958
959
|
it "should sort by number of favorites" do
|
959
960
|
@cli.followings
|
@@ -962,7 +963,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
962
963
|
end
|
963
964
|
context "--followers" do
|
964
965
|
before do
|
965
|
-
@cli.options = @cli.options.merge(
|
966
|
+
@cli.options = @cli.options.merge("followers" => true)
|
966
967
|
end
|
967
968
|
it "should sort by number of followers" do
|
968
969
|
@cli.followings
|
@@ -971,7 +972,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
971
972
|
end
|
972
973
|
context "--friends" do
|
973
974
|
before do
|
974
|
-
@cli.options = @cli.options.merge(
|
975
|
+
@cli.options = @cli.options.merge("friends" => true)
|
975
976
|
end
|
976
977
|
it "should sort by number of friends" do
|
977
978
|
@cli.followings
|
@@ -980,7 +981,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
980
981
|
end
|
981
982
|
context "--listed" do
|
982
983
|
before do
|
983
|
-
@cli.options = @cli.options.merge(
|
984
|
+
@cli.options = @cli.options.merge("listed" => true)
|
984
985
|
end
|
985
986
|
it "should sort by number of list memberships" do
|
986
987
|
@cli.followings
|
@@ -989,7 +990,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
989
990
|
end
|
990
991
|
context "--long" do
|
991
992
|
before do
|
992
|
-
@cli.options = @cli.options.merge(
|
993
|
+
@cli.options = @cli.options.merge("long" => true)
|
993
994
|
end
|
994
995
|
it "should output in long format" do
|
995
996
|
@cli.followings
|
@@ -1002,7 +1003,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1002
1003
|
end
|
1003
1004
|
context "--posted" do
|
1004
1005
|
before do
|
1005
|
-
@cli.options = @cli.options.merge(
|
1006
|
+
@cli.options = @cli.options.merge("posted" => true)
|
1006
1007
|
end
|
1007
1008
|
it "should sort by the time when Twitter acount was created" do
|
1008
1009
|
@cli.followings
|
@@ -1011,7 +1012,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1011
1012
|
end
|
1012
1013
|
context "--reverse" do
|
1013
1014
|
before do
|
1014
|
-
@cli.options = @cli.options.merge(
|
1015
|
+
@cli.options = @cli.options.merge("reverse" => true)
|
1015
1016
|
end
|
1016
1017
|
it "should reverse the order of the sort" do
|
1017
1018
|
@cli.followings
|
@@ -1020,7 +1021,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1020
1021
|
end
|
1021
1022
|
context "--tweets" do
|
1022
1023
|
before do
|
1023
|
-
@cli.options = @cli.options.merge(
|
1024
|
+
@cli.options = @cli.options.merge("tweets" => true)
|
1024
1025
|
end
|
1025
1026
|
it "should sort by number of Tweets" do
|
1026
1027
|
@cli.followings
|
@@ -1029,7 +1030,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1029
1030
|
end
|
1030
1031
|
context "--unsorted" do
|
1031
1032
|
before do
|
1032
|
-
@cli.options = @cli.options.merge(
|
1033
|
+
@cli.options = @cli.options.merge("unsorted" => true)
|
1033
1034
|
end
|
1034
1035
|
it "should not be sorted" do
|
1035
1036
|
@cli.followings
|
@@ -1054,7 +1055,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1054
1055
|
end
|
1055
1056
|
context "--id" do
|
1056
1057
|
before do
|
1057
|
-
@cli.options = @cli.options.merge(
|
1058
|
+
@cli.options = @cli.options.merge("id" => true)
|
1058
1059
|
stub_get("/1/friends/ids.json").
|
1059
1060
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
1060
1061
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -1095,7 +1096,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1095
1096
|
end
|
1096
1097
|
context "--csv" do
|
1097
1098
|
before do
|
1098
|
-
@cli.options = @cli.options.merge(
|
1099
|
+
@cli.options = @cli.options.merge("csv" => true)
|
1099
1100
|
end
|
1100
1101
|
it "should output in CSV format" do
|
1101
1102
|
@cli.followers
|
@@ -1108,7 +1109,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1108
1109
|
end
|
1109
1110
|
context "--favorites" do
|
1110
1111
|
before do
|
1111
|
-
@cli.options = @cli.options.merge(
|
1112
|
+
@cli.options = @cli.options.merge("favorites" => true)
|
1112
1113
|
end
|
1113
1114
|
it "should sort by number of favorites" do
|
1114
1115
|
@cli.followers
|
@@ -1117,7 +1118,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1117
1118
|
end
|
1118
1119
|
context "--followers" do
|
1119
1120
|
before do
|
1120
|
-
@cli.options = @cli.options.merge(
|
1121
|
+
@cli.options = @cli.options.merge("followers" => true)
|
1121
1122
|
end
|
1122
1123
|
it "should sort by number of followers" do
|
1123
1124
|
@cli.followers
|
@@ -1126,7 +1127,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1126
1127
|
end
|
1127
1128
|
context "--friends" do
|
1128
1129
|
before do
|
1129
|
-
@cli.options = @cli.options.merge(
|
1130
|
+
@cli.options = @cli.options.merge("friends" => true)
|
1130
1131
|
end
|
1131
1132
|
it "should sort by number of friends" do
|
1132
1133
|
@cli.followers
|
@@ -1135,7 +1136,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1135
1136
|
end
|
1136
1137
|
context "--listed" do
|
1137
1138
|
before do
|
1138
|
-
@cli.options = @cli.options.merge(
|
1139
|
+
@cli.options = @cli.options.merge("listed" => true)
|
1139
1140
|
end
|
1140
1141
|
it "should sort by number of list memberships" do
|
1141
1142
|
@cli.followers
|
@@ -1144,7 +1145,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1144
1145
|
end
|
1145
1146
|
context "--long" do
|
1146
1147
|
before do
|
1147
|
-
@cli.options = @cli.options.merge(
|
1148
|
+
@cli.options = @cli.options.merge("long" => true)
|
1148
1149
|
end
|
1149
1150
|
it "should output in long format" do
|
1150
1151
|
@cli.followers
|
@@ -1157,7 +1158,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1157
1158
|
end
|
1158
1159
|
context "--posted" do
|
1159
1160
|
before do
|
1160
|
-
@cli.options = @cli.options.merge(
|
1161
|
+
@cli.options = @cli.options.merge("posted" => true)
|
1161
1162
|
end
|
1162
1163
|
it "should sort by the time when Twitter acount was created" do
|
1163
1164
|
@cli.followers
|
@@ -1166,7 +1167,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1166
1167
|
end
|
1167
1168
|
context "--reverse" do
|
1168
1169
|
before do
|
1169
|
-
@cli.options = @cli.options.merge(
|
1170
|
+
@cli.options = @cli.options.merge("reverse" => true)
|
1170
1171
|
end
|
1171
1172
|
it "should reverse the order of the sort" do
|
1172
1173
|
@cli.followers
|
@@ -1175,7 +1176,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1175
1176
|
end
|
1176
1177
|
context "--tweets" do
|
1177
1178
|
before do
|
1178
|
-
@cli.options = @cli.options.merge(
|
1179
|
+
@cli.options = @cli.options.merge("tweets" => true)
|
1179
1180
|
end
|
1180
1181
|
it "should sort by number of Tweets" do
|
1181
1182
|
@cli.followers
|
@@ -1184,7 +1185,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1184
1185
|
end
|
1185
1186
|
context "--unsorted" do
|
1186
1187
|
before do
|
1187
|
-
@cli.options = @cli.options.merge(
|
1188
|
+
@cli.options = @cli.options.merge("unsorted" => true)
|
1188
1189
|
end
|
1189
1190
|
it "should not be sorted" do
|
1190
1191
|
@cli.followers
|
@@ -1211,7 +1212,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1211
1212
|
end
|
1212
1213
|
context "--id" do
|
1213
1214
|
before do
|
1214
|
-
@cli.options = @cli.options.merge(
|
1215
|
+
@cli.options = @cli.options.merge("id" => true)
|
1215
1216
|
stub_get("/1/followers/ids.json").
|
1216
1217
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
1217
1218
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -1259,7 +1260,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1259
1260
|
end
|
1260
1261
|
context "--csv" do
|
1261
1262
|
before do
|
1262
|
-
@cli.options = @cli.options.merge(
|
1263
|
+
@cli.options = @cli.options.merge("csv" => true)
|
1263
1264
|
end
|
1264
1265
|
it "should output in CSV format" do
|
1265
1266
|
@cli.friends
|
@@ -1272,7 +1273,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1272
1273
|
end
|
1273
1274
|
context "--favorites" do
|
1274
1275
|
before do
|
1275
|
-
@cli.options = @cli.options.merge(
|
1276
|
+
@cli.options = @cli.options.merge("favorites" => true)
|
1276
1277
|
end
|
1277
1278
|
it "should sort by number of favorites" do
|
1278
1279
|
@cli.friends
|
@@ -1281,7 +1282,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1281
1282
|
end
|
1282
1283
|
context "--followers" do
|
1283
1284
|
before do
|
1284
|
-
@cli.options = @cli.options.merge(
|
1285
|
+
@cli.options = @cli.options.merge("followers" => true)
|
1285
1286
|
end
|
1286
1287
|
it "should sort by number of followers" do
|
1287
1288
|
@cli.friends
|
@@ -1290,7 +1291,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1290
1291
|
end
|
1291
1292
|
context "--friends" do
|
1292
1293
|
before do
|
1293
|
-
@cli.options = @cli.options.merge(
|
1294
|
+
@cli.options = @cli.options.merge("friends" => true)
|
1294
1295
|
end
|
1295
1296
|
it "should sort by number of friends" do
|
1296
1297
|
@cli.friends
|
@@ -1299,7 +1300,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1299
1300
|
end
|
1300
1301
|
context "--listed" do
|
1301
1302
|
before do
|
1302
|
-
@cli.options = @cli.options.merge(
|
1303
|
+
@cli.options = @cli.options.merge("listed" => true)
|
1303
1304
|
end
|
1304
1305
|
it "should sort by number of list memberships" do
|
1305
1306
|
@cli.friends
|
@@ -1308,7 +1309,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1308
1309
|
end
|
1309
1310
|
context "--long" do
|
1310
1311
|
before do
|
1311
|
-
@cli.options = @cli.options.merge(
|
1312
|
+
@cli.options = @cli.options.merge("long" => true)
|
1312
1313
|
end
|
1313
1314
|
it "should output in long format" do
|
1314
1315
|
@cli.friends
|
@@ -1321,7 +1322,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1321
1322
|
end
|
1322
1323
|
context "--posted" do
|
1323
1324
|
before do
|
1324
|
-
@cli.options = @cli.options.merge(
|
1325
|
+
@cli.options = @cli.options.merge("posted" => true)
|
1325
1326
|
end
|
1326
1327
|
it "should sort by the time when Twitter acount was created" do
|
1327
1328
|
@cli.friends
|
@@ -1330,7 +1331,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1330
1331
|
end
|
1331
1332
|
context "--reverse" do
|
1332
1333
|
before do
|
1333
|
-
@cli.options = @cli.options.merge(
|
1334
|
+
@cli.options = @cli.options.merge("reverse" => true)
|
1334
1335
|
end
|
1335
1336
|
it "should reverse the order of the sort" do
|
1336
1337
|
@cli.friends
|
@@ -1339,7 +1340,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1339
1340
|
end
|
1340
1341
|
context "--tweets" do
|
1341
1342
|
before do
|
1342
|
-
@cli.options = @cli.options.merge(
|
1343
|
+
@cli.options = @cli.options.merge("tweets" => true)
|
1343
1344
|
end
|
1344
1345
|
it "should sort by number of Tweets" do
|
1345
1346
|
@cli.friends
|
@@ -1348,7 +1349,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1348
1349
|
end
|
1349
1350
|
context "--unsorted" do
|
1350
1351
|
before do
|
1351
|
-
@cli.options = @cli.options.merge(
|
1352
|
+
@cli.options = @cli.options.merge("unsorted" => true)
|
1352
1353
|
end
|
1353
1354
|
it "should not be sorted" do
|
1354
1355
|
@cli.friends
|
@@ -1378,7 +1379,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1378
1379
|
end
|
1379
1380
|
context "--id" do
|
1380
1381
|
before do
|
1381
|
-
@cli.options = @cli.options.merge(
|
1382
|
+
@cli.options = @cli.options.merge("id" => true)
|
1382
1383
|
stub_get("/1/friends/ids.json").
|
1383
1384
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
1384
1385
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -1432,7 +1433,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1432
1433
|
end
|
1433
1434
|
context "--csv" do
|
1434
1435
|
before do
|
1435
|
-
@cli.options = @cli.options.merge(
|
1436
|
+
@cli.options = @cli.options.merge("csv" => true)
|
1436
1437
|
end
|
1437
1438
|
it "should output in CSV format" do
|
1438
1439
|
@cli.leaders
|
@@ -1445,7 +1446,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1445
1446
|
end
|
1446
1447
|
context "--favorites" do
|
1447
1448
|
before do
|
1448
|
-
@cli.options = @cli.options.merge(
|
1449
|
+
@cli.options = @cli.options.merge("favorites" => true)
|
1449
1450
|
end
|
1450
1451
|
it "should sort by number of favorites" do
|
1451
1452
|
@cli.leaders
|
@@ -1454,7 +1455,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1454
1455
|
end
|
1455
1456
|
context "--followers" do
|
1456
1457
|
before do
|
1457
|
-
@cli.options = @cli.options.merge(
|
1458
|
+
@cli.options = @cli.options.merge("followers" => true)
|
1458
1459
|
end
|
1459
1460
|
it "should sort by number of followers" do
|
1460
1461
|
@cli.leaders
|
@@ -1463,7 +1464,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1463
1464
|
end
|
1464
1465
|
context "--friends" do
|
1465
1466
|
before do
|
1466
|
-
@cli.options = @cli.options.merge(
|
1467
|
+
@cli.options = @cli.options.merge("friends" => true)
|
1467
1468
|
end
|
1468
1469
|
it "should sort by number of friends" do
|
1469
1470
|
@cli.leaders
|
@@ -1472,7 +1473,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1472
1473
|
end
|
1473
1474
|
context "--listed" do
|
1474
1475
|
before do
|
1475
|
-
@cli.options = @cli.options.merge(
|
1476
|
+
@cli.options = @cli.options.merge("listed" => true)
|
1476
1477
|
end
|
1477
1478
|
it "should sort by number of list memberships" do
|
1478
1479
|
@cli.leaders
|
@@ -1481,7 +1482,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1481
1482
|
end
|
1482
1483
|
context "--long" do
|
1483
1484
|
before do
|
1484
|
-
@cli.options = @cli.options.merge(
|
1485
|
+
@cli.options = @cli.options.merge("long" => true)
|
1485
1486
|
end
|
1486
1487
|
it "should output in long format" do
|
1487
1488
|
@cli.leaders
|
@@ -1494,7 +1495,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1494
1495
|
end
|
1495
1496
|
context "--posted" do
|
1496
1497
|
before do
|
1497
|
-
@cli.options = @cli.options.merge(
|
1498
|
+
@cli.options = @cli.options.merge("posted" => true)
|
1498
1499
|
end
|
1499
1500
|
it "should sort by the time when Twitter acount was created" do
|
1500
1501
|
@cli.leaders
|
@@ -1503,7 +1504,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1503
1504
|
end
|
1504
1505
|
context "--reverse" do
|
1505
1506
|
before do
|
1506
|
-
@cli.options = @cli.options.merge(
|
1507
|
+
@cli.options = @cli.options.merge("reverse" => true)
|
1507
1508
|
end
|
1508
1509
|
it "should reverse the order of the sort" do
|
1509
1510
|
@cli.leaders
|
@@ -1512,7 +1513,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1512
1513
|
end
|
1513
1514
|
context "--tweets" do
|
1514
1515
|
before do
|
1515
|
-
@cli.options = @cli.options.merge(
|
1516
|
+
@cli.options = @cli.options.merge("tweets" => true)
|
1516
1517
|
end
|
1517
1518
|
it "should sort by number of Tweets" do
|
1518
1519
|
@cli.leaders
|
@@ -1521,7 +1522,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1521
1522
|
end
|
1522
1523
|
context "--unsorted" do
|
1523
1524
|
before do
|
1524
|
-
@cli.options = @cli.options.merge(
|
1525
|
+
@cli.options = @cli.options.merge("unsorted" => true)
|
1525
1526
|
end
|
1526
1527
|
it "should not be sorted" do
|
1527
1528
|
@cli.leaders
|
@@ -1551,7 +1552,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1551
1552
|
end
|
1552
1553
|
context "--id" do
|
1553
1554
|
before do
|
1554
|
-
@cli.options = @cli.options.merge(
|
1555
|
+
@cli.options = @cli.options.merge("id" => true)
|
1555
1556
|
stub_get("/1/friends/ids.json").
|
1556
1557
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
1557
1558
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -1593,7 +1594,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
1593
1594
|
end
|
1594
1595
|
context "--csv" do
|
1595
1596
|
before do
|
1596
|
-
@cli.options = @cli.options.merge(
|
1597
|
+
@cli.options = @cli.options.merge("csv" => true)
|
1597
1598
|
end
|
1598
1599
|
it "should output in CSV format" do
|
1599
1600
|
@cli.lists
|
@@ -1606,7 +1607,7 @@ ID,Created at,Screen name,Slug,Members,Subscribers,Mode,Description
|
|
1606
1607
|
end
|
1607
1608
|
context "--long" do
|
1608
1609
|
before do
|
1609
|
-
@cli.options = @cli.options.merge(
|
1610
|
+
@cli.options = @cli.options.merge("long" => true)
|
1610
1611
|
end
|
1611
1612
|
it "should output in long format" do
|
1612
1613
|
@cli.lists
|
@@ -1619,7 +1620,7 @@ ID Created at Slug Members Subscribers Mode
|
|
1619
1620
|
end
|
1620
1621
|
context "--members" do
|
1621
1622
|
before do
|
1622
|
-
@cli.options = @cli.options.merge(
|
1623
|
+
@cli.options = @cli.options.merge("members" => true)
|
1623
1624
|
end
|
1624
1625
|
it "should sort by the time when Twitter acount was created" do
|
1625
1626
|
@cli.lists
|
@@ -1628,7 +1629,7 @@ ID Created at Slug Members Subscribers Mode
|
|
1628
1629
|
end
|
1629
1630
|
context "--mode" do
|
1630
1631
|
before do
|
1631
|
-
@cli.options = @cli.options.merge(
|
1632
|
+
@cli.options = @cli.options.merge("mode" => true)
|
1632
1633
|
end
|
1633
1634
|
it "should sort by the time when Twitter acount was created" do
|
1634
1635
|
@cli.lists
|
@@ -1637,7 +1638,7 @@ ID Created at Slug Members Subscribers Mode
|
|
1637
1638
|
end
|
1638
1639
|
context "--posted" do
|
1639
1640
|
before do
|
1640
|
-
@cli.options = @cli.options.merge(
|
1641
|
+
@cli.options = @cli.options.merge("posted" => true)
|
1641
1642
|
end
|
1642
1643
|
it "should sort by the time when Twitter acount was created" do
|
1643
1644
|
@cli.lists
|
@@ -1646,7 +1647,7 @@ ID Created at Slug Members Subscribers Mode
|
|
1646
1647
|
end
|
1647
1648
|
context "--reverse" do
|
1648
1649
|
before do
|
1649
|
-
@cli.options = @cli.options.merge(
|
1650
|
+
@cli.options = @cli.options.merge("reverse" => true)
|
1650
1651
|
end
|
1651
1652
|
it "should reverse the order of the sort" do
|
1652
1653
|
@cli.lists
|
@@ -1655,7 +1656,7 @@ ID Created at Slug Members Subscribers Mode
|
|
1655
1656
|
end
|
1656
1657
|
context "--subscribers" do
|
1657
1658
|
before do
|
1658
|
-
@cli.options = @cli.options.merge(
|
1659
|
+
@cli.options = @cli.options.merge("subscribers" => true)
|
1659
1660
|
end
|
1660
1661
|
it "should sort by the time when Twitter acount was created" do
|
1661
1662
|
@cli.lists
|
@@ -1664,7 +1665,7 @@ ID Created at Slug Members Subscribers Mode
|
|
1664
1665
|
end
|
1665
1666
|
context "--unsorted" do
|
1666
1667
|
before do
|
1667
|
-
@cli.options = @cli.options.merge(
|
1668
|
+
@cli.options = @cli.options.merge("unsorted" => true)
|
1668
1669
|
end
|
1669
1670
|
it "should not be sorted" do
|
1670
1671
|
@cli.lists
|
@@ -1685,7 +1686,7 @@ ID Created at Slug Members Subscribers Mode
|
|
1685
1686
|
end
|
1686
1687
|
context "--id" do
|
1687
1688
|
before do
|
1688
|
-
@cli.options = @cli.options.merge(
|
1689
|
+
@cli.options = @cli.options.merge("id" => true)
|
1689
1690
|
stub_get("/1/lists.json").
|
1690
1691
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
1691
1692
|
to_return(:body => fixture("lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -1702,6 +1703,7 @@ ID Created at Slug Members Subscribers Mode
|
|
1702
1703
|
|
1703
1704
|
describe "#mentions" do
|
1704
1705
|
before do
|
1706
|
+
@cli.options = @cli.options.merge("no-color" => true)
|
1705
1707
|
stub_get("/1/statuses/mentions.json").
|
1706
1708
|
with(:query => {:count => "20", :include_entities => "false"}).
|
1707
1709
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -1736,7 +1738,7 @@ ID Created at Slug Members Subscribers Mode
|
|
1736
1738
|
end
|
1737
1739
|
context "--csv" do
|
1738
1740
|
before do
|
1739
|
-
@cli.options = @cli.options.merge(
|
1741
|
+
@cli.options = @cli.options.merge("csv" => true)
|
1740
1742
|
end
|
1741
1743
|
it "should output in CSV format" do
|
1742
1744
|
@cli.mentions
|
@@ -1764,7 +1766,7 @@ ID,Posted at,Screen name,Text
|
|
1764
1766
|
end
|
1765
1767
|
context "--long" do
|
1766
1768
|
before do
|
1767
|
-
@cli.options = @cli.options.merge(
|
1769
|
+
@cli.options = @cli.options.merge("long" => true)
|
1768
1770
|
end
|
1769
1771
|
it "should output in long format" do
|
1770
1772
|
@cli.mentions
|
@@ -1792,7 +1794,7 @@ ID Posted at Screen name Text
|
|
1792
1794
|
end
|
1793
1795
|
context "--number" do
|
1794
1796
|
before do
|
1795
|
-
@cli.options = @cli.options.merge(
|
1797
|
+
@cli.options = @cli.options.merge("number" => 1)
|
1796
1798
|
stub_get("/1/statuses/mentions.json").
|
1797
1799
|
with(:query => {:count => "1", :include_entities => "false"}).
|
1798
1800
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -1806,7 +1808,7 @@ ID Posted at Screen name Text
|
|
1806
1808
|
end
|
1807
1809
|
context "--reverse" do
|
1808
1810
|
before do
|
1809
|
-
@cli.options = @cli.options.merge(
|
1811
|
+
@cli.options = @cli.options.merge("reverse" => true)
|
1810
1812
|
end
|
1811
1813
|
it "should reverse the order of the sort" do
|
1812
1814
|
@cli.mentions
|
@@ -1835,7 +1837,7 @@ ID Posted at Screen name Text
|
|
1835
1837
|
|
1836
1838
|
describe "#open" do
|
1837
1839
|
before do
|
1838
|
-
@cli.options = @cli.options.merge(
|
1840
|
+
@cli.options = @cli.options.merge("display-url" => true)
|
1839
1841
|
end
|
1840
1842
|
it "should have the correct output" do
|
1841
1843
|
lambda do
|
@@ -1844,7 +1846,7 @@ ID Posted at Screen name Text
|
|
1844
1846
|
end
|
1845
1847
|
context "--id" do
|
1846
1848
|
before do
|
1847
|
-
@cli.options = @cli.options.merge(
|
1849
|
+
@cli.options = @cli.options.merge("id" => true)
|
1848
1850
|
stub_get("/1/users/show.json").
|
1849
1851
|
with(:query => {:user_id => "420", :include_entities => "false"}).
|
1850
1852
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -1858,7 +1860,7 @@ ID Posted at Screen name Text
|
|
1858
1860
|
end
|
1859
1861
|
context "--status" do
|
1860
1862
|
before do
|
1861
|
-
@cli.options = @cli.options.merge(
|
1863
|
+
@cli.options = @cli.options.merge("status" => true)
|
1862
1864
|
stub_get("/1/statuses/show/55709764298092545.json").
|
1863
1865
|
with(:query => {:include_entities => "false", :include_my_retweet => "false"}).
|
1864
1866
|
to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -1879,7 +1881,7 @@ ID Posted at Screen name Text
|
|
1879
1881
|
|
1880
1882
|
describe "#reply" do
|
1881
1883
|
before do
|
1882
|
-
@cli.options = @cli.options.merge(
|
1884
|
+
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc", "location" => true)
|
1883
1885
|
stub_get("/1/statuses/show/55709764298092545.json").
|
1884
1886
|
with(:query => {:include_entities => "false", :include_my_retweet => "false"}).
|
1885
1887
|
to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -1910,7 +1912,7 @@ ID Posted at Screen name Text
|
|
1910
1912
|
end
|
1911
1913
|
context "--all" do
|
1912
1914
|
before do
|
1913
|
-
@cli.options = @cli.options.merge(
|
1915
|
+
@cli.options = @cli.options.merge("all" => true)
|
1914
1916
|
end
|
1915
1917
|
it "should request the correct resource" do
|
1916
1918
|
@cli.reply("55709764298092545", "Testing")
|
@@ -1934,7 +1936,7 @@ ID Posted at Screen name Text
|
|
1934
1936
|
|
1935
1937
|
describe "#report_spam" do
|
1936
1938
|
before do
|
1937
|
-
@cli.options = @cli.options.merge(
|
1939
|
+
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
1938
1940
|
stub_post("/1/report_spam.json").
|
1939
1941
|
with(:body => {:screen_name => "sferik", :include_entities => "false"}).
|
1940
1942
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -1951,7 +1953,7 @@ ID Posted at Screen name Text
|
|
1951
1953
|
end
|
1952
1954
|
context "--id" do
|
1953
1955
|
before do
|
1954
|
-
@cli.options = @cli.options.merge(
|
1956
|
+
@cli.options = @cli.options.merge("id" => true)
|
1955
1957
|
stub_post("/1/report_spam.json").
|
1956
1958
|
with(:body => {:user_id => "7505382", :include_entities => "false"}).
|
1957
1959
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -1967,7 +1969,7 @@ ID Posted at Screen name Text
|
|
1967
1969
|
|
1968
1970
|
describe "#retweet" do
|
1969
1971
|
before do
|
1970
|
-
@cli.options = @cli.options.merge(
|
1972
|
+
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
1971
1973
|
stub_post("/1/statuses/retweet/26755176471724032.json").
|
1972
1974
|
to_return(:body => fixture("retweet.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1973
1975
|
end
|
@@ -1984,6 +1986,7 @@ ID Posted at Screen name Text
|
|
1984
1986
|
|
1985
1987
|
describe "#retweets" do
|
1986
1988
|
before do
|
1989
|
+
@cli.options = @cli.options.merge("no-color" => true)
|
1987
1990
|
stub_get("/1/statuses/retweeted_by_me.json").
|
1988
1991
|
with(:query => {:count => "20", :include_entities => "false"}).
|
1989
1992
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -2020,7 +2023,7 @@ ID Posted at Screen name Text
|
|
2020
2023
|
end
|
2021
2024
|
context "--csv" do
|
2022
2025
|
before do
|
2023
|
-
@cli.options = @cli.options.merge(
|
2026
|
+
@cli.options = @cli.options.merge("csv" => true)
|
2024
2027
|
end
|
2025
2028
|
it "should output in CSV format" do
|
2026
2029
|
@cli.retweets
|
@@ -2048,7 +2051,7 @@ ID,Posted at,Screen name,Text
|
|
2048
2051
|
end
|
2049
2052
|
context "--long" do
|
2050
2053
|
before do
|
2051
|
-
@cli.options = @cli.options.merge(
|
2054
|
+
@cli.options = @cli.options.merge("long" => true)
|
2052
2055
|
end
|
2053
2056
|
it "should output in long format" do
|
2054
2057
|
@cli.retweets
|
@@ -2076,7 +2079,7 @@ ID Posted at Screen name Text
|
|
2076
2079
|
end
|
2077
2080
|
context "--number" do
|
2078
2081
|
before do
|
2079
|
-
@cli.options = @cli.options.merge(
|
2082
|
+
@cli.options = @cli.options.merge("number" => 1)
|
2080
2083
|
stub_get("/1/statuses/retweeted_by_me.json").
|
2081
2084
|
with(:query => {:count => "1", :include_entities => "false"}).
|
2082
2085
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -2090,7 +2093,7 @@ ID Posted at Screen name Text
|
|
2090
2093
|
end
|
2091
2094
|
context "--reverse" do
|
2092
2095
|
before do
|
2093
|
-
@cli.options = @cli.options.merge(
|
2096
|
+
@cli.options = @cli.options.merge("reverse" => true)
|
2094
2097
|
end
|
2095
2098
|
it "should reverse the order of the sort" do
|
2096
2099
|
@cli.retweets
|
@@ -2129,7 +2132,7 @@ ID Posted at Screen name Text
|
|
2129
2132
|
end
|
2130
2133
|
context "--id" do
|
2131
2134
|
before do
|
2132
|
-
@cli.options = @cli.options.merge(
|
2135
|
+
@cli.options = @cli.options.merge("id" => true)
|
2133
2136
|
stub_get("/1/statuses/retweeted_by_user.json").
|
2134
2137
|
with(:query => {:count => "20", :include_entities => "false", :user_id => "7505382"}).
|
2135
2138
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -2178,7 +2181,7 @@ URL https://twitter.com/sferik/status/55709764298092545
|
|
2178
2181
|
end
|
2179
2182
|
context "--csv" do
|
2180
2183
|
before do
|
2181
|
-
@cli.options = @cli.options.merge(
|
2184
|
+
@cli.options = @cli.options.merge("csv" => true)
|
2182
2185
|
end
|
2183
2186
|
it "should have the correct output" do
|
2184
2187
|
@cli.status("55709764298092545")
|
@@ -2212,7 +2215,7 @@ ID,Text,Screen name,Posted at,Location,Retweets,Source,URL
|
|
2212
2215
|
end
|
2213
2216
|
context "--csv" do
|
2214
2217
|
before do
|
2215
|
-
@cli.options = @cli.options.merge(
|
2218
|
+
@cli.options = @cli.options.merge("csv" => true)
|
2216
2219
|
end
|
2217
2220
|
it "should output in CSV format" do
|
2218
2221
|
@cli.suggest
|
@@ -2228,7 +2231,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
2228
2231
|
end
|
2229
2232
|
context "--favorites" do
|
2230
2233
|
before do
|
2231
|
-
@cli.options = @cli.options.merge(
|
2234
|
+
@cli.options = @cli.options.merge("favorites" => true)
|
2232
2235
|
end
|
2233
2236
|
it "should sort by number of favorites" do
|
2234
2237
|
@cli.suggest
|
@@ -2237,7 +2240,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
2237
2240
|
end
|
2238
2241
|
context "--followers" do
|
2239
2242
|
before do
|
2240
|
-
@cli.options = @cli.options.merge(
|
2243
|
+
@cli.options = @cli.options.merge("followers" => true)
|
2241
2244
|
end
|
2242
2245
|
it "should sort by number of followers" do
|
2243
2246
|
@cli.suggest
|
@@ -2246,7 +2249,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
2246
2249
|
end
|
2247
2250
|
context "--friends" do
|
2248
2251
|
before do
|
2249
|
-
@cli.options = @cli.options.merge(
|
2252
|
+
@cli.options = @cli.options.merge("friends" => true)
|
2250
2253
|
end
|
2251
2254
|
it "should sort by number of friends" do
|
2252
2255
|
@cli.suggest
|
@@ -2255,7 +2258,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
2255
2258
|
end
|
2256
2259
|
context "--listed" do
|
2257
2260
|
before do
|
2258
|
-
@cli.options = @cli.options.merge(
|
2261
|
+
@cli.options = @cli.options.merge("listed" => true)
|
2259
2262
|
end
|
2260
2263
|
it "should sort by number of list memberships" do
|
2261
2264
|
@cli.suggest
|
@@ -2264,7 +2267,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
2264
2267
|
end
|
2265
2268
|
context "--long" do
|
2266
2269
|
before do
|
2267
|
-
@cli.options = @cli.options.merge(
|
2270
|
+
@cli.options = @cli.options.merge("long" => true)
|
2268
2271
|
end
|
2269
2272
|
it "should output in long format" do
|
2270
2273
|
@cli.suggest
|
@@ -2280,7 +2283,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
2280
2283
|
end
|
2281
2284
|
context "--number" do
|
2282
2285
|
before do
|
2283
|
-
@cli.options = @cli.options.merge(
|
2286
|
+
@cli.options = @cli.options.merge("number" => 1)
|
2284
2287
|
stub_get("/1/users/recommendations.json").
|
2285
2288
|
with(:query => {:limit => "1", :include_entities => "false", :screen_name => "sferik"}).
|
2286
2289
|
to_return(:body => fixture("recommendations.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -2294,7 +2297,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
2294
2297
|
end
|
2295
2298
|
context "--posted" do
|
2296
2299
|
before do
|
2297
|
-
@cli.options = @cli.options.merge(
|
2300
|
+
@cli.options = @cli.options.merge("posted" => true)
|
2298
2301
|
end
|
2299
2302
|
it "should sort by the time when Twitter acount was created" do
|
2300
2303
|
@cli.suggest
|
@@ -2303,7 +2306,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
2303
2306
|
end
|
2304
2307
|
context "--reverse" do
|
2305
2308
|
before do
|
2306
|
-
@cli.options = @cli.options.merge(
|
2309
|
+
@cli.options = @cli.options.merge("reverse" => true)
|
2307
2310
|
end
|
2308
2311
|
it "should reverse the order of the sort" do
|
2309
2312
|
@cli.suggest
|
@@ -2312,7 +2315,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
2312
2315
|
end
|
2313
2316
|
context "--tweets" do
|
2314
2317
|
before do
|
2315
|
-
@cli.options = @cli.options.merge(
|
2318
|
+
@cli.options = @cli.options.merge("tweets" => true)
|
2316
2319
|
end
|
2317
2320
|
it "should sort by number of Tweets" do
|
2318
2321
|
@cli.suggest
|
@@ -2321,7 +2324,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
2321
2324
|
end
|
2322
2325
|
context "--unsorted" do
|
2323
2326
|
before do
|
2324
|
-
@cli.options = @cli.options.merge(
|
2327
|
+
@cli.options = @cli.options.merge("unsorted" => true)
|
2325
2328
|
end
|
2326
2329
|
it "should not be sorted" do
|
2327
2330
|
@cli.suggest
|
@@ -2341,7 +2344,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
2341
2344
|
end
|
2342
2345
|
context "--id" do
|
2343
2346
|
before do
|
2344
|
-
@cli.options = @cli.options.merge(
|
2347
|
+
@cli.options = @cli.options.merge("id" => true)
|
2345
2348
|
stub_get("/1/users/recommendations.json").
|
2346
2349
|
with(:query => {:limit => "20", :include_entities => "false", :user_id => "7505382"}).
|
2347
2350
|
to_return(:body => fixture("recommendations.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -2358,6 +2361,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
2358
2361
|
|
2359
2362
|
describe "#timeline" do
|
2360
2363
|
before do
|
2364
|
+
@cli.options = @cli.options.merge("no-color" => true)
|
2361
2365
|
stub_get("/1/statuses/home_timeline.json").
|
2362
2366
|
with(:query => {:count => "20", :include_entities => "false"}).
|
2363
2367
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -2394,7 +2398,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
2394
2398
|
end
|
2395
2399
|
context "--csv" do
|
2396
2400
|
before do
|
2397
|
-
@cli.options = @cli.options.merge(
|
2401
|
+
@cli.options = @cli.options.merge("csv" => true)
|
2398
2402
|
end
|
2399
2403
|
it "should output in CSV format" do
|
2400
2404
|
@cli.timeline
|
@@ -2422,7 +2426,7 @@ ID,Posted at,Screen name,Text
|
|
2422
2426
|
end
|
2423
2427
|
context "--long" do
|
2424
2428
|
before do
|
2425
|
-
@cli.options = @cli.options.merge(
|
2429
|
+
@cli.options = @cli.options.merge("long" => true)
|
2426
2430
|
end
|
2427
2431
|
it "should output in long format" do
|
2428
2432
|
@cli.timeline
|
@@ -2450,7 +2454,7 @@ ID Posted at Screen name Text
|
|
2450
2454
|
end
|
2451
2455
|
context "--number" do
|
2452
2456
|
before do
|
2453
|
-
@cli.options = @cli.options.merge(
|
2457
|
+
@cli.options = @cli.options.merge("number" => 1)
|
2454
2458
|
stub_get("/1/statuses/home_timeline.json").
|
2455
2459
|
with(:query => {:count => "1", :include_entities => "false"}).
|
2456
2460
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -2464,7 +2468,7 @@ ID Posted at Screen name Text
|
|
2464
2468
|
end
|
2465
2469
|
context "--reverse" do
|
2466
2470
|
before do
|
2467
|
-
@cli.options = @cli.options.merge(
|
2471
|
+
@cli.options = @cli.options.merge("reverse" => true)
|
2468
2472
|
end
|
2469
2473
|
it "should reverse the order of the sort" do
|
2470
2474
|
@cli.timeline
|
@@ -2503,7 +2507,7 @@ ID Posted at Screen name Text
|
|
2503
2507
|
end
|
2504
2508
|
context "--id" do
|
2505
2509
|
before do
|
2506
|
-
@cli.options = @cli.options.merge(
|
2510
|
+
@cli.options = @cli.options.merge("id" => true)
|
2507
2511
|
stub_get("/1/statuses/user_timeline.json").
|
2508
2512
|
with(:query => {:count => "20", :include_entities => "false", :user_id => "7505382"}).
|
2509
2513
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -2532,9 +2536,9 @@ ID Posted at Screen name Text
|
|
2532
2536
|
@cli.trends
|
2533
2537
|
$stdout.string.rstrip.should == "#sevenwordsaftersex Walkman Allen Iverson"
|
2534
2538
|
end
|
2535
|
-
context "--
|
2539
|
+
context "--exclude-hashtags" do
|
2536
2540
|
before do
|
2537
|
-
@cli.options = @cli.options.merge(
|
2541
|
+
@cli.options = @cli.options.merge("exclude-hashtags" => true)
|
2538
2542
|
stub_get("/1/trends/1.json").
|
2539
2543
|
with(:query => {:exclude => "hashtags"}).
|
2540
2544
|
to_return(:body => fixture("trends.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -2583,7 +2587,7 @@ ID Posted at Screen name Text
|
|
2583
2587
|
end
|
2584
2588
|
context "--csv" do
|
2585
2589
|
before do
|
2586
|
-
@cli.options = @cli.options.merge(
|
2590
|
+
@cli.options = @cli.options.merge("csv" => true)
|
2587
2591
|
end
|
2588
2592
|
it "should output in CSV format" do
|
2589
2593
|
@cli.trend_locations
|
@@ -2599,7 +2603,7 @@ WOEID,Parent ID,Type,Name,Country
|
|
2599
2603
|
end
|
2600
2604
|
context "--long" do
|
2601
2605
|
before do
|
2602
|
-
@cli.options = @cli.options.merge(
|
2606
|
+
@cli.options = @cli.options.merge("long" => true)
|
2603
2607
|
end
|
2604
2608
|
it "should output in long format" do
|
2605
2609
|
@cli.trend_locations
|
@@ -2615,7 +2619,7 @@ WOEID Parent ID Type Name Country
|
|
2615
2619
|
end
|
2616
2620
|
context "--reverse" do
|
2617
2621
|
before do
|
2618
|
-
@cli.options = @cli.options.merge(
|
2622
|
+
@cli.options = @cli.options.merge("reverse" => true)
|
2619
2623
|
end
|
2620
2624
|
it "should reverse the order of the sort" do
|
2621
2625
|
@cli.trend_locations
|
@@ -2624,7 +2628,7 @@ WOEID Parent ID Type Name Country
|
|
2624
2628
|
end
|
2625
2629
|
context "--unsorted" do
|
2626
2630
|
before do
|
2627
|
-
@cli.options = @cli.options.merge(
|
2631
|
+
@cli.options = @cli.options.merge("unsorted" => true)
|
2628
2632
|
end
|
2629
2633
|
it "should not be sorted" do
|
2630
2634
|
@cli.trend_locations
|
@@ -2635,7 +2639,7 @@ WOEID Parent ID Type Name Country
|
|
2635
2639
|
|
2636
2640
|
describe "#unfollow" do
|
2637
2641
|
before do
|
2638
|
-
@cli.options = @cli.options.merge(
|
2642
|
+
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
2639
2643
|
end
|
2640
2644
|
context "one user" do
|
2641
2645
|
it "should request the correct resource" do
|
@@ -2656,7 +2660,7 @@ WOEID Parent ID Type Name Country
|
|
2656
2660
|
end
|
2657
2661
|
context "--id" do
|
2658
2662
|
before do
|
2659
|
-
@cli.options = @cli.options.merge(
|
2663
|
+
@cli.options = @cli.options.merge("id" => true)
|
2660
2664
|
stub_delete("/1/friendships/destroy.json").
|
2661
2665
|
with(:query => {:user_id => "7505382", :include_entities => "false"}).
|
2662
2666
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -2686,7 +2690,7 @@ WOEID Parent ID Type Name Country
|
|
2686
2690
|
|
2687
2691
|
describe "#update" do
|
2688
2692
|
before do
|
2689
|
-
@cli.options = @cli.options.merge(
|
2693
|
+
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc", "location" => true)
|
2690
2694
|
stub_post("/1/statuses/update.json").
|
2691
2695
|
with(:body => {:status => "Testing", :lat => "37.76969909668", :long => "-122.39330291748", :include_entities => "false", :trim_user => "true"}).
|
2692
2696
|
to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -2729,7 +2733,7 @@ WOEID Parent ID Type Name Country
|
|
2729
2733
|
end
|
2730
2734
|
context "--csv" do
|
2731
2735
|
before do
|
2732
|
-
@cli.options = @cli.options.merge(
|
2736
|
+
@cli.options = @cli.options.merge("csv" => true)
|
2733
2737
|
end
|
2734
2738
|
it "should output in CSV format" do
|
2735
2739
|
@cli.users("sferik", "pengwynn")
|
@@ -2742,7 +2746,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
2742
2746
|
end
|
2743
2747
|
context "--favorites" do
|
2744
2748
|
before do
|
2745
|
-
@cli.options = @cli.options.merge(
|
2749
|
+
@cli.options = @cli.options.merge("favorites" => true)
|
2746
2750
|
end
|
2747
2751
|
it "should sort by number of favorites" do
|
2748
2752
|
@cli.users("sferik", "pengwynn")
|
@@ -2751,7 +2755,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
2751
2755
|
end
|
2752
2756
|
context "--followers" do
|
2753
2757
|
before do
|
2754
|
-
@cli.options = @cli.options.merge(
|
2758
|
+
@cli.options = @cli.options.merge("followers" => true)
|
2755
2759
|
end
|
2756
2760
|
it "should sort by number of followers" do
|
2757
2761
|
@cli.users("sferik", "pengwynn")
|
@@ -2760,7 +2764,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
2760
2764
|
end
|
2761
2765
|
context "--friends" do
|
2762
2766
|
before do
|
2763
|
-
@cli.options = @cli.options.merge(
|
2767
|
+
@cli.options = @cli.options.merge("friends" => true)
|
2764
2768
|
end
|
2765
2769
|
it "should sort by number of friends" do
|
2766
2770
|
@cli.users("sferik", "pengwynn")
|
@@ -2769,7 +2773,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
2769
2773
|
end
|
2770
2774
|
context "--id" do
|
2771
2775
|
before do
|
2772
|
-
@cli.options = @cli.options.merge(
|
2776
|
+
@cli.options = @cli.options.merge("id" => true)
|
2773
2777
|
stub_get("/1/users/lookup.json").
|
2774
2778
|
with(:query => {:user_id => "7505382,14100886", :include_entities => "false"}).
|
2775
2779
|
to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
@@ -2783,7 +2787,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
2783
2787
|
end
|
2784
2788
|
context "--listed" do
|
2785
2789
|
before do
|
2786
|
-
@cli.options = @cli.options.merge(
|
2790
|
+
@cli.options = @cli.options.merge("listed" => true)
|
2787
2791
|
end
|
2788
2792
|
it "should sort by number of list memberships" do
|
2789
2793
|
@cli.users("sferik", "pengwynn")
|
@@ -2792,7 +2796,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
2792
2796
|
end
|
2793
2797
|
context "--long" do
|
2794
2798
|
before do
|
2795
|
-
@cli.options = @cli.options.merge(
|
2799
|
+
@cli.options = @cli.options.merge("long" => true)
|
2796
2800
|
end
|
2797
2801
|
it "should output in long format" do
|
2798
2802
|
@cli.users("sferik", "pengwynn")
|
@@ -2805,7 +2809,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
2805
2809
|
end
|
2806
2810
|
context "--posted" do
|
2807
2811
|
before do
|
2808
|
-
@cli.options = @cli.options.merge(
|
2812
|
+
@cli.options = @cli.options.merge("posted" => true)
|
2809
2813
|
end
|
2810
2814
|
it "should sort by the time when Twitter acount was created" do
|
2811
2815
|
@cli.users("sferik", "pengwynn")
|
@@ -2814,7 +2818,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
2814
2818
|
end
|
2815
2819
|
context "--reverse" do
|
2816
2820
|
before do
|
2817
|
-
@cli.options = @cli.options.merge(
|
2821
|
+
@cli.options = @cli.options.merge("reverse" => true)
|
2818
2822
|
end
|
2819
2823
|
it "should reverse the order of the sort" do
|
2820
2824
|
@cli.users("sferik", "pengwynn")
|
@@ -2823,7 +2827,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
2823
2827
|
end
|
2824
2828
|
context "--tweets" do
|
2825
2829
|
before do
|
2826
|
-
@cli.options = @cli.options.merge(
|
2830
|
+
@cli.options = @cli.options.merge("tweets" => true)
|
2827
2831
|
end
|
2828
2832
|
it "should sort by number of Tweets" do
|
2829
2833
|
@cli.users("sferik", "pengwynn")
|
@@ -2832,7 +2836,7 @@ ID Since Tweets Favorites Listed Following Followers Screen
|
|
2832
2836
|
end
|
2833
2837
|
context "--unsorted" do
|
2834
2838
|
before do
|
2835
|
-
@cli.options = @cli.options.merge(
|
2839
|
+
@cli.options = @cli.options.merge("unsorted" => true)
|
2836
2840
|
end
|
2837
2841
|
it "should not be sorted" do
|
2838
2842
|
@cli.users("sferik", "pengwynn")
|
@@ -2880,7 +2884,7 @@ URL https://github.com/sferik
|
|
2880
2884
|
end
|
2881
2885
|
context "--csv" do
|
2882
2886
|
before do
|
2883
|
-
@cli.options = @cli.options.merge(
|
2887
|
+
@cli.options = @cli.options.merge("csv" => true)
|
2884
2888
|
end
|
2885
2889
|
it "should have the correct output" do
|
2886
2890
|
@cli.whois("sferik")
|
@@ -2892,7 +2896,7 @@ ID,Verified,Name,Screen name,Bio,Location,Following,Last update,Lasted updated a
|
|
2892
2896
|
end
|
2893
2897
|
context "--id" do
|
2894
2898
|
before do
|
2895
|
-
@cli.options = @cli.options.merge(
|
2899
|
+
@cli.options = @cli.options.merge("id" => true)
|
2896
2900
|
stub_get("/1/users/show.json").
|
2897
2901
|
with(:query => {:user_id => "7505382", :include_entities => "false"}).
|
2898
2902
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|