termtter 1.6.0 → 1.7.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.
Files changed (98) hide show
  1. data/.gitignore +5 -0
  2. data/README.rdoc +2 -2
  3. data/Rakefile +41 -75
  4. data/VERSION +1 -0
  5. data/bin/termtter +9 -2
  6. data/doc/Termtter-1.0-Release-Note-English.txt +37 -0
  7. data/doc/Termtter-1.0-Release-Note.txt +37 -0
  8. data/lib/plugins/another_prompt.rb +8 -8
  9. data/lib/plugins/ar.rb +102 -0
  10. data/lib/plugins/async.rb +1 -1
  11. data/lib/plugins/babelfish.rb +34 -0
  12. data/lib/plugins/confirm.rb +2 -0
  13. data/lib/plugins/crypt.rb +44 -0
  14. data/lib/plugins/defaults/auto_reload.rb +1 -1
  15. data/lib/plugins/defaults/command_line.rb +34 -17
  16. data/lib/plugins/defaults/confirm.rb +30 -0
  17. data/lib/plugins/defaults/hashtag.rb +1 -1
  18. data/lib/plugins/defaults/irb.rb +30 -0
  19. data/lib/plugins/defaults/keyword.rb +58 -0
  20. data/lib/plugins/defaults/list.rb +155 -0
  21. data/lib/plugins/defaults/plugin.rb +59 -0
  22. data/lib/plugins/defaults/retweet.rb +75 -23
  23. data/lib/plugins/defaults/standard_commands.rb +60 -87
  24. data/lib/plugins/defaults/standard_completion.rb +25 -15
  25. data/lib/plugins/defaults/stdout.rb +49 -10
  26. data/lib/plugins/defaults/switch.rb +1 -1
  27. data/lib/plugins/defaults/users.rb +63 -0
  28. data/lib/plugins/draft.rb +58 -0
  29. data/lib/plugins/expand-tinyurl.rb +5 -9
  30. data/lib/plugins/favotter.rb +1 -1
  31. data/lib/plugins/footer.rb +22 -0
  32. data/lib/plugins/friends.rb +5 -4
  33. data/lib/plugins/g.rb +9 -16
  34. data/lib/plugins/gem_install.rb +24 -0
  35. data/lib/plugins/gist.rb +20 -0
  36. data/lib/plugins/grass.rb +1 -1
  37. data/lib/plugins/gyazo.rb +78 -0
  38. data/lib/plugins/http_server.rb +1 -1
  39. data/lib/plugins/hugeurl.rb +6 -13
  40. data/lib/plugins/irc_gw.rb +15 -11
  41. data/lib/plugins/me.rb +1 -1
  42. data/lib/plugins/notify-send.rb +1 -1
  43. data/lib/plugins/notify-send3.rb +1 -1
  44. data/lib/plugins/open.rb +1 -1
  45. data/lib/plugins/open_url.rb +5 -1
  46. data/lib/plugins/pool.rb +1 -1
  47. data/lib/plugins/random.rb +1 -1
  48. data/lib/plugins/reply_retweet.rb +42 -0
  49. data/lib/plugins/screen-notify.rb +1 -1
  50. data/lib/plugins/sl.rb +3 -3
  51. data/lib/plugins/storage.rb +7 -10
  52. data/lib/plugins/storage/sqlite3.rb +155 -0
  53. data/lib/plugins/storage/status.rb +2 -0
  54. data/lib/plugins/stream.rb +1 -1
  55. data/lib/plugins/tinyurl.rb +3 -9
  56. data/lib/plugins/trends.rb +2 -2
  57. data/lib/plugins/truncate.rb +1 -1
  58. data/lib/plugins/w3mimg.rb +1 -1
  59. data/lib/termtter.rb +19 -20
  60. data/lib/termtter/active_rubytter.rb +4 -0
  61. data/lib/termtter/api.rb +22 -5
  62. data/lib/termtter/client.rb +55 -40
  63. data/lib/termtter/command.rb +3 -2
  64. data/lib/termtter/config_setup.rb +1 -1
  65. data/lib/termtter/config_template.erb +5 -0
  66. data/lib/termtter/default_config.rb +18 -0
  67. data/lib/termtter/hookable.rb +1 -0
  68. data/lib/termtter/httppool.rb +44 -0
  69. data/lib/termtter/memory_cache.rb +32 -0
  70. data/lib/termtter/optparse.rb +8 -15
  71. data/lib/termtter/rubytter_proxy.rb +65 -4
  72. data/lib/termtter/system_extensions.rb +40 -9
  73. data/lib/termtter/task.rb +2 -1
  74. data/spec/plugins/defaults/hashtag_spec.rb +8 -7
  75. data/spec/plugins/defaults/list_spec.rb +33 -0
  76. data/spec/plugins/defaults/plugin_spec.rb +17 -0
  77. data/spec/plugins/defaults/retweet_spec.rb +205 -0
  78. data/spec/plugins/draft_spec.rb +59 -0
  79. data/spec/plugins/expand-tinyurl_spec.rb +21 -0
  80. data/spec/plugins/footer_spec.rb +50 -0
  81. data/spec/plugins/storage/sqlite3_spec.rb +41 -0
  82. data/spec/termtter/api_spec.rb +1 -1
  83. data/spec/termtter/client_spec.rb +21 -21
  84. data/spec/termtter/command_spec.rb +8 -8
  85. data/spec/termtter/config_spec.rb +2 -2
  86. data/spec/termtter/memory_cache_spec.rb +20 -0
  87. data/spec/termtter/optparse_spec.rb +1 -1
  88. data/spec/termtter/rubytter_proxy_spec.rb +38 -0
  89. data/spec/termtter/system_extensions_spec.rb +25 -23
  90. data/spec/termtter/task_manager_spec.rb +1 -1
  91. data/spec/termtter_spec.rb +4 -2
  92. metadata +88 -19
  93. data/lib/plugins/defaults/lists.rb +0 -14
  94. data/lib/plugins/irb.rb +0 -6
  95. data/lib/plugins/storage/DB.rb +0 -37
  96. data/lib/termtter/version.rb +0 -4
  97. data/spec/plugins/defaults/lists_spec.rb +0 -34
  98. data/spec/plugins/storage/DB_spec_.rb +0 -12
@@ -12,32 +12,34 @@ describe Termtter do
12
12
 
13
13
  it 'provides win?' do
14
14
  be_quiet do
15
- original_ruby_platform = RUBY_PLATFORM
16
- RUBY_PLATFORM = 'darwin'
15
+ original_ruby_platform = ::RUBY_PLATFORM
16
+ ::RUBY_PLATFORM = 'darwin'
17
17
  win?.should == false
18
- RUBY_PLATFORM = 'mswin'
18
+ ::RUBY_PLATFORM = 'mswin'
19
19
  win?.should == true
20
- RUBY_PLATFORM = original_ruby_platform
20
+ ::RUBY_PLATFORM = original_ruby_platform
21
21
  end
22
22
  end
23
23
 
24
- it 'Readline can refresh line' do
25
- Readline::LIBREADLINE.should_receive(:rl_refresh_line).with(0, 0)
26
- Readline.refresh_line
27
- end
24
+ if Readline.const_defined?(:LIBREADLINE)
25
+ it 'Readline can refresh line' do
26
+ Readline::LIBREADLINE.should_receive(:rl_refresh_line).with(0, 0)
27
+ Readline.refresh_line
28
+ end
28
29
 
29
- it 'extend DL::Impoter when not be able to find DL::Importable' do
30
- DL::Importer = mock(:importer)
31
- DL.stub(:const_defined?).with(:Importable).and_return(false)
32
- Readline::LIBREADLINE.should_receive(:extend).with(DL::Importer)
33
- load 'termtter/system_extensions.rb'
34
- end
30
+ it 'extend DL::Impoter when not be able to find DL::Importable' do
31
+ be_quiet { DL::Importer = mock(:importer) }
32
+ DL.stub(:const_defined?).with(:Importable).and_return(false)
33
+ Readline::LIBREADLINE.should_receive(:extend).with(DL::Importer)
34
+ load 'termtter/system_extensions.rb'
35
+ end
35
36
 
36
- it 'can handle error when difine LIBREADLINE' do
37
- Readline::LIBREADLINE.stub(:extend) { raise }
38
- load 'termtter/system_extensions.rb'
39
- Readline::LIBREADLINE.should_not_receive(:rl_refresh_line)
40
- Readline.refresh_line
37
+ it 'can handle error when difine LIBREADLINE' do
38
+ Readline::LIBREADLINE.stub(:extend) { raise }
39
+ load 'termtter/system_extensions.rb'
40
+ Readline::LIBREADLINE.should_not_receive(:rl_refresh_line)
41
+ Readline.refresh_line
42
+ end
41
43
  end
42
44
 
43
45
  it 'can open browser that suites platform' do
@@ -45,13 +47,13 @@ describe Termtter do
45
47
  url = 'example.com'
46
48
  [
47
49
  ['linux', 'firefox'],
48
- ['mswin', 'explorer'],
49
- ['mingw', 'explorer'],
50
- ['bccwin', 'explorer'],
50
+ ['mswin', 'start'],
51
+ ['mingw', 'start'],
52
+ ['bccwin', 'start'],
51
53
  ['darwin', 'open'],
52
54
  ['hogehog', 'open'],
53
55
  ].each do |platform, browser|
54
- RUBY_PLATFORM = platform
56
+ ::RUBY_PLATFORM = platform
55
57
  self.should_receive(:system).with(browser, url)
56
58
  open_browser(url)
57
59
  end
@@ -129,7 +129,7 @@ module Termtter
129
129
  called = false
130
130
  block = lambda { called = true}
131
131
  @task_manager.should_receive(:invoke_and_wait).with(&block)
132
- @task_manager.invoke_later &block
132
+ @task_manager.invoke_later(&block).join
133
133
  called.should be_true
134
134
  end
135
135
  end
@@ -30,10 +30,12 @@ end
30
30
  describe Termtter, 'when termtter is loaded' do
31
31
  it 'will add load path' do
32
32
  termtter_path = File.expand_path(File.dirname(__FILE__) + '/../lib/termtter.rb')
33
+ termtter_lib_path = File.dirname(termtter_path)
33
34
  original_load_path = $:.dup
34
- $:.clear
35
+ $:.delete(termtter_lib_path)
36
+ $:.include?(termtter_lib_path).should == false
35
37
  be_quiet { load termtter_path }
36
- $:.include?(File.dirname(termtter_path)).should == true
38
+ $:.include?(termtter_lib_path).should == true
37
39
  $:.concat(original_load_path)
38
40
  end
39
41
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: termtter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jugyo
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-11-30 00:00:00 +09:00
13
+ date: 2010-01-24 00:00:00 +09:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -51,7 +51,7 @@ dependencies:
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.9.2
54
+ version: 0.11.0
55
55
  version:
56
56
  description: Termtter is a terminal based Twitter client.
57
57
  email: jugyo.org@gmail.com
@@ -61,38 +61,53 @@ executables:
61
61
  extensions: []
62
62
 
63
63
  extra_rdoc_files:
64
- - README.rdoc
65
64
  - ChangeLog
66
- files:
67
- - Rakefile
68
65
  - README.rdoc
66
+ files:
67
+ - .gitignore
69
68
  - ChangeLog
69
+ - README.rdoc
70
+ - Rakefile
71
+ - VERSION
72
+ - bin/kill_termtter
73
+ - bin/termtter
74
+ - doc/Termtter-1.0-Release-Note-English.txt
75
+ - doc/Termtter-1.0-Release-Note.txt
70
76
  - lib/plugins/addspace.rb
71
77
  - lib/plugins/another_prompt.rb
72
78
  - lib/plugins/april_fool.rb
79
+ - lib/plugins/ar.rb
73
80
  - lib/plugins/async.rb
81
+ - lib/plugins/babelfish.rb
74
82
  - lib/plugins/bomb.rb
75
83
  - lib/plugins/clear.rb
76
84
  - lib/plugins/command_plus.rb
77
85
  - lib/plugins/confirm.rb
78
86
  - lib/plugins/cool.rb
79
87
  - lib/plugins/countter.rb
88
+ - lib/plugins/crypt.rb
80
89
  - lib/plugins/curry.rb
81
90
  - lib/plugins/db.rb
91
+ - lib/plugins/defaults.rb
82
92
  - lib/plugins/defaults/alias.rb
83
93
  - lib/plugins/defaults/auto_reload.rb
84
94
  - lib/plugins/defaults/command_line.rb
95
+ - lib/plugins/defaults/confirm.rb
85
96
  - lib/plugins/defaults/eval.rb
86
97
  - lib/plugins/defaults/exec.rb
87
98
  - lib/plugins/defaults/fib.rb
88
99
  - lib/plugins/defaults/hashtag.rb
89
- - lib/plugins/defaults/lists.rb
100
+ - lib/plugins/defaults/irb.rb
101
+ - lib/plugins/defaults/keyword.rb
102
+ - lib/plugins/defaults/list.rb
103
+ - lib/plugins/defaults/plugin.rb
90
104
  - lib/plugins/defaults/retweet.rb
91
105
  - lib/plugins/defaults/standard_commands.rb
92
106
  - lib/plugins/defaults/standard_completion.rb
93
107
  - lib/plugins/defaults/stdout.rb
94
108
  - lib/plugins/defaults/switch.rb
95
- - lib/plugins/defaults.rb
109
+ - lib/plugins/defaults/users.rb
110
+ - lib/plugins/draft.rb
96
111
  - lib/plugins/eject.rb
97
112
  - lib/plugins/en2ja.rb
98
113
  - lib/plugins/english.rb
@@ -103,8 +118,11 @@ files:
103
118
  - lib/plugins/fib_filter.rb
104
119
  - lib/plugins/fibyou.rb
105
120
  - lib/plugins/filter.rb
121
+ - lib/plugins/footer.rb
106
122
  - lib/plugins/friends.rb
107
123
  - lib/plugins/g.rb
124
+ - lib/plugins/gem_install.rb
125
+ - lib/plugins/gist.rb
108
126
  - lib/plugins/github-issues.rb
109
127
  - lib/plugins/graduatter.rb
110
128
  - lib/plugins/grass.rb
@@ -112,17 +130,17 @@ files:
112
130
  - lib/plugins/growl.rb
113
131
  - lib/plugins/growl2.rb
114
132
  - lib/plugins/gsub.rb
133
+ - lib/plugins/gyazo.rb
115
134
  - lib/plugins/haml.rb
116
135
  - lib/plugins/hatebu.rb
117
136
  - lib/plugins/hatebu_and_update.rb
118
137
  - lib/plugins/hi.rb
119
138
  - lib/plugins/history.rb
139
+ - lib/plugins/http_server.rb
120
140
  - lib/plugins/http_server/favicon.ico
121
141
  - lib/plugins/http_server/index.html
122
- - lib/plugins/http_server.rb
123
142
  - lib/plugins/hugeurl.rb
124
143
  - lib/plugins/ignore.rb
125
- - lib/plugins/irb.rb
126
144
  - lib/plugins/irc_gw.rb
127
145
  - lib/plugins/itunes.rb
128
146
  - lib/plugins/jakigan.rb
@@ -162,6 +180,7 @@ files:
162
180
  - lib/plugins/reload.rb
163
181
  - lib/plugins/replace.rb
164
182
  - lib/plugins/reply.rb
183
+ - lib/plugins/reply_retweet.rb
165
184
  - lib/plugins/reverse.rb
166
185
  - lib/plugins/say.rb
167
186
  - lib/plugins/saykanji.rb
@@ -174,10 +193,10 @@ files:
174
193
  - lib/plugins/sl.rb
175
194
  - lib/plugins/source.rb
176
195
  - lib/plugins/spam.rb
177
- - lib/plugins/storage/DB.rb
196
+ - lib/plugins/storage.rb
197
+ - lib/plugins/storage/sqlite3.rb
178
198
  - lib/plugins/storage/status.rb
179
199
  - lib/plugins/storage/status_mook.rb
180
- - lib/plugins/storage.rb
181
200
  - lib/plugins/stream.rb
182
201
  - lib/plugins/switch_user.rb
183
202
  - lib/plugins/system_status.rb
@@ -198,6 +217,7 @@ files:
198
217
  - lib/plugins/yhara.rb
199
218
  - lib/plugins/yhara_filter.rb
200
219
  - lib/plugins/yonda.rb
220
+ - lib/termtter.rb
201
221
  - lib/termtter/active_rubytter.rb
202
222
  - lib/termtter/api.rb
203
223
  - lib/termtter/client.rb
@@ -205,26 +225,32 @@ files:
205
225
  - lib/termtter/config.rb
206
226
  - lib/termtter/config_setup.rb
207
227
  - lib/termtter/config_template.erb
228
+ - lib/termtter/default_config.rb
208
229
  - lib/termtter/hook.rb
209
230
  - lib/termtter/hookable.rb
231
+ - lib/termtter/httppool.rb
232
+ - lib/termtter/memory_cache.rb
210
233
  - lib/termtter/optparse.rb
211
234
  - lib/termtter/rubytter_proxy.rb
235
+ - lib/termtter/system_extensions.rb
212
236
  - lib/termtter/system_extensions/core_compatibles.rb
213
237
  - lib/termtter/system_extensions/termtter_compatibles.rb
214
238
  - lib/termtter/system_extensions/windows.rb
215
- - lib/termtter/system_extensions.rb
216
239
  - lib/termtter/task.rb
217
240
  - lib/termtter/task_manager.rb
218
- - lib/termtter/version.rb
219
- - lib/termtter.rb
220
241
  - spec/plugins/cool_spec.rb
221
242
  - spec/plugins/curry_spec.rb
222
243
  - spec/plugins/db_spec.rb
223
244
  - spec/plugins/defaults/hashtag_spec.rb
224
- - spec/plugins/defaults/lists_spec.rb
245
+ - spec/plugins/defaults/list_spec.rb
246
+ - spec/plugins/defaults/plugin_spec.rb
247
+ - spec/plugins/defaults/retweet_spec.rb
248
+ - spec/plugins/draft_spec.rb
225
249
  - spec/plugins/english_spec_.rb
250
+ - spec/plugins/expand-tinyurl_spec.rb
226
251
  - spec/plugins/fib_spec.rb
227
252
  - spec/plugins/filter_spec_.rb
253
+ - spec/plugins/footer_spec.rb
228
254
  - spec/plugins/gsub_spec.rb
229
255
  - spec/plugins/haml_spec.rb
230
256
  - spec/plugins/md5pass_spec.rb
@@ -234,7 +260,7 @@ files:
234
260
  - spec/plugins/sl_spec_.rb
235
261
  - spec/plugins/spam_spec.rb
236
262
  - spec/plugins/standard_commands_spec.rb
237
- - spec/plugins/storage/DB_spec_.rb
263
+ - spec/plugins/storage/sqlite3_spec.rb
238
264
  - spec/plugins/storage/status_spec_.rb
239
265
  - spec/plugins/truncate_spec.rb
240
266
  - spec/plugins/whois_spec_.rb
@@ -247,6 +273,7 @@ files:
247
273
  - spec/termtter/config_spec.rb
248
274
  - spec/termtter/hook_spec.rb
249
275
  - spec/termtter/hookable_spec.rb
276
+ - spec/termtter/memory_cache_spec.rb
250
277
  - spec/termtter/optparse_spec.rb
251
278
  - spec/termtter/rubytter_proxy_spec.rb
252
279
  - spec/termtter/system_extensions/windows_spec.rb
@@ -287,5 +314,47 @@ rubygems_version: 1.3.5
287
314
  signing_key:
288
315
  specification_version: 3
289
316
  summary: Terminal based Twitter client.
290
- test_files: []
291
-
317
+ test_files:
318
+ - spec/plugins/cool_spec.rb
319
+ - spec/plugins/curry_spec.rb
320
+ - spec/plugins/db_spec.rb
321
+ - spec/plugins/defaults/hashtag_spec.rb
322
+ - spec/plugins/defaults/list_spec.rb
323
+ - spec/plugins/defaults/plugin_spec.rb
324
+ - spec/plugins/defaults/retweet_spec.rb
325
+ - spec/plugins/draft_spec.rb
326
+ - spec/plugins/english_spec_.rb
327
+ - spec/plugins/expand-tinyurl_spec.rb
328
+ - spec/plugins/fib_spec.rb
329
+ - spec/plugins/filter_spec_.rb
330
+ - spec/plugins/footer_spec.rb
331
+ - spec/plugins/gsub_spec.rb
332
+ - spec/plugins/haml_spec.rb
333
+ - spec/plugins/md5pass_spec.rb
334
+ - spec/plugins/pause_spec.rb
335
+ - spec/plugins/primes_spec_.rb
336
+ - spec/plugins/shell_spec.rb
337
+ - spec/plugins/sl_spec_.rb
338
+ - spec/plugins/spam_spec.rb
339
+ - spec/plugins/standard_commands_spec.rb
340
+ - spec/plugins/storage/sqlite3_spec.rb
341
+ - spec/plugins/storage/status_spec_.rb
342
+ - spec/plugins/truncate_spec.rb
343
+ - spec/plugins/whois_spec_.rb
344
+ - spec/spec_helper.rb
345
+ - spec/termtter/active_rubytter_spec.rb
346
+ - spec/termtter/api_spec.rb
347
+ - spec/termtter/client_spec.rb
348
+ - spec/termtter/command_spec.rb
349
+ - spec/termtter/config_setup_spec.rb
350
+ - spec/termtter/config_spec.rb
351
+ - spec/termtter/hook_spec.rb
352
+ - spec/termtter/hookable_spec.rb
353
+ - spec/termtter/memory_cache_spec.rb
354
+ - spec/termtter/optparse_spec.rb
355
+ - spec/termtter/rubytter_proxy_spec.rb
356
+ - spec/termtter/system_extensions/windows_spec.rb
357
+ - spec/termtter/system_extensions_spec.rb
358
+ - spec/termtter/task_manager_spec.rb
359
+ - spec/termtter/task_spec.rb
360
+ - spec/termtter_spec.rb
@@ -1,14 +0,0 @@
1
- module Termtter::Client
2
- register_command(
3
- :name => :lists,
4
- :exec => lambda {|arg|
5
- unless arg.empty?
6
- user_name = normalize_as_user_name(arg)
7
- else
8
- user_name = config.user_name
9
- end
10
- # TODO: show more information of lists
11
- puts Termtter::API.twitter.lists(user_name).lists.map{|i| i.slug}
12
- }
13
- )
14
- end
data/lib/plugins/irb.rb DELETED
@@ -1,6 +0,0 @@
1
- require 'irb'
2
- Termtter::Client.register_command(:irb) do |*args|
3
- args.unshift('irb')
4
- args.delete_if{|i| i == ""}
5
- system *args
6
- end
@@ -1,37 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- require 'sqlite3'
4
- require 'singleton'
5
-
6
- module Termtter::Storage
7
- class DB
8
- include Singleton
9
- attr_reader :db
10
-
11
- def initialize
12
- @db = SQLite3::Database.new(Termtter::CONF_DIR + '/storage.db')
13
- @db.type_translation = true
14
- create_table
15
- end
16
-
17
- def create_table
18
- sql =<<-SQL
19
- CREATE TABLE IF NOT EXISTS user (
20
- id int NOT NULL,
21
- screen_name text,
22
- PRIMARY KEY (id)
23
- );
24
- CREATE TABLE IF NOT EXISTS post (
25
- post_id int NOT NULL, -- twitter側のpostのid
26
- created_at int, -- 日付(RubyでUNIX時間に変換)
27
- in_reply_to_status_id int, -- あったほうがよいらしい
28
- in_reply_to_user_id int, -- あったほうがよいらしい
29
- post_text text,
30
- user_id int NOT NULL,
31
- PRIMARY KEY (post_id)
32
- );
33
- SQL
34
- @db.execute_batch(sql)
35
- end
36
- end
37
- end
@@ -1,4 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- module Termtter
3
- VERSION = '1.6.0'
4
- end
@@ -1,34 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../spec_helper'
2
-
3
- describe 'plugin lists' do
4
- before do
5
- config.user_name = 'jugyo'
6
- @twitter_stub = Object.new
7
- Termtter::API.stub!(:twitter).and_return(@twitter_stub)
8
- end
9
-
10
- describe 'command lists' do
11
- before do
12
- Termtter::Client.plug 'defaults'
13
- @command = Termtter::Client.commands[:lists]
14
- end
15
-
16
- it 'command name is :lists' do
17
- @command.name.should == :lists
18
- end
19
-
20
- it 'should call with no user_name' do
21
- response = Object.new
22
- response.stub!(:lists).and_return({})
23
- @twitter_stub.should_receive(:lists).with('jugyo').and_return(response)
24
- Termtter::Client.call_commands('lists')
25
- end
26
-
27
- it 'should call with user_name' do
28
- response = Object.new
29
- response.stub!(:lists).and_return({})
30
- @twitter_stub.should_receive(:lists).with('termtter').and_return(response)
31
- Termtter::Client.call_commands('lists termtter')
32
- end
33
- end
34
- end
@@ -1,12 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- require File.dirname(__FILE__) + '/../../spec_helper'
4
- require File.dirname(__FILE__) + '/../../../lib/plugins/storage/DB'
5
-
6
- module Termtter::Storage
7
- describe DB do
8
- before do
9
- @db = DB.instance.db
10
- end
11
- end
12
- end