t 0.9.7 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/t.rb +1 -1
- data/lib/t/authorizable.rb +10 -2
- data/lib/t/cli.rb +92 -28
- data/lib/t/collectable.rb +7 -4
- data/lib/t/delete.rb +13 -6
- data/lib/t/format_helpers.rb +44 -44
- data/lib/t/list.rb +22 -14
- data/lib/t/printable.rb +156 -145
- data/lib/t/rcfile.rb +2 -1
- data/lib/t/requestable.rb +21 -21
- data/lib/t/search.rb +12 -8
- data/lib/t/set.rb +3 -3
- data/lib/t/stream.rb +13 -5
- data/lib/t/version.rb +1 -1
- data/spec/cli_spec.rb +190 -78
- data/spec/fixtures/search.json +111 -1
- data/spec/fixtures/statuses.json +180 -0
- data/spec/format_helpers_spec.rb +96 -0
- data/spec/list_spec.rb +24 -5
- data/spec/search_spec.rb +23 -3
- metadata +4 -2
data/spec/search_spec.rb
CHANGED
@@ -53,6 +53,11 @@ describe T::Search do
|
|
53
53
|
@search.all("twitter")
|
54
54
|
$stdout.string.should == <<-eos
|
55
55
|
ID,Posted at,Screen name,Text
|
56
|
+
194521323202624150,2011-04-23 20:20:57 +0000,Somedude,Gotta get right with twitter
|
57
|
+
194526951936212623,2011-04-23 20:20:57 +0000,TestMan,Twitter to Facebook test
|
58
|
+
194521346690562622,2011-04-23 20:20:57 +0000,Jena_Jones,test my new twitter..... :)
|
59
|
+
194521262134160820,2011-04-23 20:20:57 +0000,misterpic,Wallah there should be a test before you can get a twitter account some people are so dumb... better
|
60
|
+
194521016652621340,2011-04-23 20:20:57 +0000,RRabbit,Twitter is kinda fun... Kinda!
|
56
61
|
194521262415032320,2011-04-23 20:20:57 +0000,JessRoveel,Pondre lo mas importante de Hamlet en Twitter para recordarlo mejor :D
|
57
62
|
194521262326951936,2011-04-23 20:20:57 +0000,lauravgeest,Twitter doet het al 7 uur niet meer
|
58
63
|
194521262234669056,2011-04-23 20:20:57 +0000,Jenny_Bearx333,"I keep thinking that twitter is @instagram , and therefore double tap all the pics I like... #NotWorking"
|
@@ -83,6 +88,11 @@ ID,Posted at,Screen name,Text
|
|
83
88
|
@search.all("twitter")
|
84
89
|
$stdout.string.should == <<-eos
|
85
90
|
ID Posted at Screen name Text
|
91
|
+
194521323202624150 Apr 23 2011 @Somedude Gotta get right with twitter
|
92
|
+
194526951936212623 Apr 23 2011 @TestMan Twitter to Facebook test
|
93
|
+
194521346690562622 Apr 23 2011 @Jena_Jones test my new twitter..... :)
|
94
|
+
194521262134160820 Apr 23 2011 @misterpic Wallah there should be a ...
|
95
|
+
194521016652621340 Apr 23 2011 @RRabbit Twitter is kinda fun... K...
|
86
96
|
194521262415032320 Apr 23 2011 @JessRoveel Pondre lo mas importante ...
|
87
97
|
194521262326951936 Apr 23 2011 @lauravgeest Twitter doet het al 7 uur...
|
88
98
|
194521262234669056 Apr 23 2011 @Jenny_Bearx333 I keep thinking that twit...
|
@@ -110,8 +120,13 @@ ID Posted at Screen name Text
|
|
110
120
|
with(:query => {:q => "twitter", :rpp => "200"}).
|
111
121
|
to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
112
122
|
stub_request(:get, "https://search.twitter.com/search.json").
|
113
|
-
with(:query => {:q => "twitter", :rpp => "
|
123
|
+
with(:query => {:q => "twitter", :rpp => "200", :max_id => "194521261307727871"}).
|
114
124
|
to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
125
|
+
(5..185).step(20).to_a.reverse.each do |count|
|
126
|
+
stub_request(:get, "https://search.twitter.com/search.json").
|
127
|
+
with(:query => {:q => "twitter", :rpp => count, :max_id => "194521261307727871"}).
|
128
|
+
to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
129
|
+
end
|
115
130
|
end
|
116
131
|
it "should limit the number of results to 1" do
|
117
132
|
@search.options = @search.options.merge("number" => 1)
|
@@ -127,8 +142,13 @@ ID Posted at Screen name Text
|
|
127
142
|
with(:query => {:q => "twitter", :rpp => "200"}).
|
128
143
|
should have_been_made
|
129
144
|
a_request(:get, "https://search.twitter.com/search.json").
|
130
|
-
with(:query => {:q => "twitter", :rpp => "
|
131
|
-
should have_been_made
|
145
|
+
with(:query => {:q => "twitter", :rpp => "200", :max_id => "194521261307727871"}).
|
146
|
+
should have_been_made.times(7)
|
147
|
+
(5..185).step(20).to_a.reverse.each do |count|
|
148
|
+
a_request(:get, "https://search.twitter.com/search.json").
|
149
|
+
with(:query => {:q => "twitter", :rpp => count, :max_id => "194521261307727871"}).
|
150
|
+
should have_been_made
|
151
|
+
end
|
132
152
|
end
|
133
153
|
end
|
134
154
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: t
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -378,6 +378,7 @@ files:
|
|
378
378
|
- spec/fixtures/users.json
|
379
379
|
- spec/fixtures/users_list.json
|
380
380
|
- spec/fixtures/xml.gp
|
381
|
+
- spec/format_helpers_spec.rb
|
381
382
|
- spec/helper.rb
|
382
383
|
- spec/list_spec.rb
|
383
384
|
- spec/rcfile_spec.rb
|
@@ -447,6 +448,7 @@ test_files:
|
|
447
448
|
- spec/fixtures/users.json
|
448
449
|
- spec/fixtures/users_list.json
|
449
450
|
- spec/fixtures/xml.gp
|
451
|
+
- spec/format_helpers_spec.rb
|
450
452
|
- spec/helper.rb
|
451
453
|
- spec/list_spec.rb
|
452
454
|
- spec/rcfile_spec.rb
|