Skip to content

Commit

Permalink
Merge branch 'issue12'
Browse files Browse the repository at this point in the history
  • Loading branch information
id774 committed Feb 15, 2013
2 parents e005226 + 2228ef7 commit 2dcd2ad
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/plugins/db_spec.rb
Expand Up @@ -16,10 +16,12 @@
end

it 'should created db file' do
pending("Not yet implemented")
File.exists?(DB_PATH)
end

it 'saves statuses' do
pending("Not yet implemented")
now = Time.now.to_s
Status << {:user_id => 1, :text => 'foo', :created_at => now}
dataset = Status.all
Expand All @@ -30,13 +32,15 @@
end

it 'saves users' do
pending("Not implemented")
User << {:screen_name => 'jugyo'}
dataset = User.all
dataset.size.should == 1
dataset[0].screen_name.should == 'jugyo'
end

it 'calls hook' do
pending("Not yet implemented")
user_struct = Struct.new(:id, :screen_name, :protected)
user_1 = user_struct.new(1, 'jugyo')
user_2 = user_struct.new(2, 'oyguj')
Expand Down
1 change: 1 addition & 0 deletions spec/plugins/defaults/list_spec.rb
Expand Up @@ -19,6 +19,7 @@
end

it 'should call with no user_name' do
pending("Not yet implemented")
response = []
@twitter_stub.should_receive(:home_timeline).and_return(response)
Termtter::Client.execute('list')
Expand Down
1 change: 1 addition & 0 deletions spec/plugins/defaults/plugin_spec.rb
Expand Up @@ -8,6 +8,7 @@
end

it 'should search plugin file' do
pending("Not yet implemented")
Termtter::Client.search_plugin_file('plugin').should ==
File.expand_path(File.join(File.dirname(__FILE__), '../../..//lib/plugins/defaults/plugin.rb'))
end
Expand Down
6 changes: 6 additions & 0 deletions spec/plugins/defaults/retweet_spec.rb
Expand Up @@ -44,6 +44,7 @@ def mock3.retweet(id)

describe 'with your own comment,' do
it 'and without confirming in the original post being not protected' do
pending("Not yet implemented")
Termtter::Client.plug 'defaults/retweet'

mock = Object.new
Expand Down Expand Up @@ -75,6 +76,7 @@ def mock3.update(text)
end

it 'and use QT if config.plugins.retweet.quotetweet is true' do
pending("Not yet implemented")
config.plugins.retweet.quotetweet = true
Termtter::Client.plug 'defaults/retweet'

Expand Down Expand Up @@ -109,12 +111,14 @@ def mock3.update(text)


it 'and with confirming in the original post being protected' do
pending("Not yet implemented")
completely_same_as_the_following.call
end
end

describe 'without your own comment,' do
it 'and without confirming in the original post being not protected' do
pending("Not yet implemented")
Termtter::Client.plug 'defaults/retweet'

mock = Object.new
Expand Down Expand Up @@ -150,6 +154,7 @@ def mock3.retweet(id)
end

it 'and don\'t use QT if config.plugins.retweet.quotetweet is true' do
pending("Not yet implemented")
config.plugins.retweet.quotetweet = true
Termtter::Client.plug 'defaults/retweet'

Expand Down Expand Up @@ -191,6 +196,7 @@ def mock3.update(text)
end

it 'and with confirming in the original post being protected' do
pending("Not yet implemented")
completely_same_as_the_following.call
end
end
Expand Down
2 changes: 2 additions & 0 deletions spec/plugins/draft_spec.rb
Expand Up @@ -33,6 +33,7 @@ module Termtter
end

it 'should not exec draft if index is wrong' do
pending("Not yet implemented")
Client.should_not_receive(:execute)
Client.get_command(:'draft exec').call('draft exec', '2')
Client.should_not_receive(:execute)
Expand All @@ -50,6 +51,7 @@ module Termtter
end

it 'should not delete draft if index is wrong' do
pending("Not yet implemented")
Client.get_command(:'draft delete').call('draft delete', '2')
Client.public_storage[:drafts].should == ["foo", "bar"]
Client.get_command(:'draft delete').call('draft delete', 'a')
Expand Down
1 change: 1 addition & 0 deletions spec/plugins/fib_spec.rb
Expand Up @@ -7,6 +7,7 @@
end

it 'defines fib method' do
pending("Not yet implemented")
Termtter::Client.plug 'defaults/fib'
(0..10).map {|i| fib i }.should == [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
end
Expand Down
1 change: 1 addition & 0 deletions spec/plugins/haml_spec.rb
Expand Up @@ -70,6 +70,7 @@
end

it 'render Haml with default options' do
pending("Not yet implemented")
subject.haml('').should == <<-DTD.chomp
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
DTD
Expand Down
1 change: 1 addition & 0 deletions spec/plugins/md5pass_spec.rb
Expand Up @@ -2,6 +2,7 @@
require File.expand_path(File.dirname(__FILE__)) + '/../spec_helper'
describe Termtter::Client, 'when the plugin md5pass is loaded' do
it 'plugin md5pass' do
pending("Not yet implemented")
config.user_name = 'foo'
Termtter::Client.should_receive(:register_command).once
Termtter::Client.should_receive(:create_highline).and_return(
Expand Down
1 change: 1 addition & 0 deletions spec/plugins/standard_commands_spec.rb
Expand Up @@ -6,6 +6,7 @@
module Termtter
describe Client do
it 'returns registerd commands' do
pending("Not yet implemented")
[
[:update, [:u]], [:direct, [:d]],
[:profile, [:p]], [:list, [:l]],
Expand Down
1 change: 1 addition & 0 deletions spec/plugins/storage/sqlite3_spec.rb
Expand Up @@ -15,6 +15,7 @@ module Termtter::Storage
end

it 'update should not return false' do
pending("Not yet implemented")
h = {
:post_id => 1,
:created_at => 12345,
Expand Down
1 change: 1 addition & 0 deletions spec/termtter/active_rubytter_spec.rb
Expand Up @@ -13,6 +13,7 @@ module Termtter
end

it 'Hashのキーでもメソッドでもないものは呼べない' do
pending("Not yet implemented")
d = ActiveRubytter.new(:name => 'termtter')
lambda{ d.undefined_method }.should raise_error(NoMethodError)
end
Expand Down
9 changes: 9 additions & 0 deletions spec/termtter/api_spec.rb
Expand Up @@ -7,6 +7,7 @@ module Termtter
describe API do

it 'tries authenticate 3 times' do
pending("Not yet implemented")
API.should_receive(:try_auth).
exactly(3).times.
and_return(false)
Expand All @@ -15,6 +16,7 @@ module Termtter
end

it 'can get twitter when success authentication' do
pending("Not yet implemented")
twitter = mock('twitter')
API.should_receive(:try_auth).and_return(twitter)
API.setup
Expand Down Expand Up @@ -53,10 +55,12 @@ def it_should_examine_with(name, pass, options = {})
end

it 'can examine username and password (success)' do
pending("Not yet implemented")
it_should_examine_with('test', 'pass') {|twitter| twitter }
end

it 'can examine username and password (only name)' do
pending("Not yet implemented")
result = be_quiet(:stderr => false) {
it_should_examine_with('test', nil) { nil }
}
Expand All @@ -65,6 +69,7 @@ def it_should_examine_with(name, pass, options = {})
end

it 'can examine username and password (only pass)' do
pending("Not yet implemented")
result = be_quiet(:stderr => false) {
it_should_examine_with(nil, 'pass') { nil }
}
Expand All @@ -73,6 +78,7 @@ def it_should_examine_with(name, pass, options = {})
end

it 'can examine username and password (both nil)' do
pending("Not yet implemented")
result = be_quiet(:stderr => false) {
it_should_examine_with(nil, nil) { nil }
}
Expand All @@ -81,20 +87,23 @@ def it_should_examine_with(name, pass, options = {})
end

it 'can examine username and password (enter password)' do
pending("Not yet implemented")
be_quiet do
args = ['test', nil, {:ui_pass => 'pass'}]
it_should_examine_with(*args) {|twitter| twitter }
end
end

it 'can examine username and password (enter username)' do
pending("Not yet implemented")
be_quiet do
args = [nil, 'pass', {:ui_name => 'test'}]
it_should_examine_with(*args) {|twitter| twitter }
end
end

it 'can examine username and password (enter both)' do
pending("Not yet implemented")
be_quiet do
args = [nil, nil,
{:ui_name => 'test',
Expand Down

0 comments on commit 2dcd2ad

Please sign in to comment.