-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sven Fuchs
committed
Apr 1, 2010
1 parent
4473f2b
commit de5fd8e
Showing
20 changed files
with
355 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,41 @@ | |||
require File.expand_path('../../test_helper', __FILE__) | |||
|
|||
class CommandCreateTest < Test::Unit::TestCase | |||
def setup | |||
setup_stubs | |||
@now = Time.now | |||
Time.stubs(:now).returns(@now) | |||
end | |||
|
|||
test '!create (w/o arguments) polls the twitter profile' do | |||
command('svenfuchs', '@rugb !create').run | |||
assert_profile('svenfuchs', 'twitter', :claimed_at => @now) | |||
end | |||
|
|||
test '!create twitter:svenfuchs polls the twitter profile, same shit' do | |||
command('svenfuchs', '@rugb !create').run | |||
assert_profile('svenfuchs', 'twitter', :claimed_at => @now) | |||
end | |||
|
|||
test '!create github:svenfuchs polls the twitter and github profiles' do | |||
command('svenfuchs', '@rugb !create github:svenfuchs').run | |||
assert_profile('svenfuchs', 'twitter', :claimed_at => @now) | |||
assert_profile('svenfuchs', 'github', :claimed_at => @now) | |||
end | |||
|
|||
test '!create http://github.com/svenfuchs polls the twitter and github profiles' do | |||
command('svenfuchs', '@rugb !create http://github.com/svenfuchs').run | |||
assert_profile('svenfuchs', 'twitter', :claimed_at => @now) | |||
assert_profile('svenfuchs', 'github', :claimed_at => @now) | |||
end | |||
|
|||
test '!create http://tinyurl.com/yc7t8bv polls the twitter and json profiles AND updates from github BUT NOT twitter' do | |||
source_url = Identity::Sources['github'].source_url('hax') | |||
Identity::Sources::Base.expects(:get).with(source_url).never | |||
|
|||
command('svenfuchs', '@rugb !create http://tinyurl.com/yc7t8bv').run | |||
assert_profile('svenfuchs', 'twitter', :claimed_at => @now) | |||
assert_profile('svenfuchs', 'json', :claimed_at => @now) | |||
assert_profile('svenphoox', 'github', :claimed_at => @now) | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,45 @@ | |||
require File.expand_path('../../test_helper', __FILE__) | |||
|
|||
class CommandUpdateExistingTest < Test::Unit::TestCase | |||
def setup | |||
setup_stubs | |||
@now = Time.now | |||
Time.stubs(:now).returns(@now) | |||
|
|||
Identity.create( | |||
:json => profile('json', 'svenfuchs').merge(:email => 'will_be_overwritten'), | |||
:twitter => profile('twitter', 'svenfuchs').merge(:name => 'will_be_overwritten'), | |||
:github => profile('github', 'svenfuchs').merge(:name => 'will_be_overwritten') | |||
) | |||
end | |||
|
|||
test '!update updates all known profiles' do | |||
command('svenfuchs', '@rugb !update').run | |||
assert_profiles('svenfuchs', 'twitter', 'json') | |||
assert_profile('svenphoox', 'github') | |||
end | |||
|
|||
test '!update twitter:svenfuchs updates the twitter profile' do | |||
command('svenfuchs', '@rugb !update twitter:svenfuchs').run | |||
assert_profile('svenfuchs', 'twitter') | |||
end | |||
|
|||
test '!update github:svenfuchs updates the github profile' do | |||
command('svenfuchs', '@rugb !update github:svenfuchs').run | |||
assert_profile('svenfuchs', 'github') | |||
end | |||
|
|||
test '!update http://github.com/svenfuchs updates the github profile' do | |||
command('svenfuchs', '@rugb !update http://github.com/svenfuchs').run | |||
assert_profile('svenfuchs', 'github') | |||
end | |||
|
|||
test '!update http://tinyurl.com/yc7t8bv updates the json profiles AND updates from github BUT NOT twitter' do | |||
source_url = Identity::Sources['github'].source_url('hax') | |||
Identity::Sources::Base.expects(:get).with(source_url).never | |||
|
|||
command('svenfuchs', '@rugb !update http://tinyurl.com/yc7t8bv').run | |||
assert_profiles('svenfuchs', 'json') | |||
assert_profile('svenphoox', 'github') | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,39 @@ | |||
require File.expand_path('../../test_helper', __FILE__) | |||
|
|||
class CommandUpdateNewTest < Test::Unit::TestCase | |||
def setup | |||
setup_stubs | |||
@now = Time.now | |||
Time.stubs(:now).returns(@now) | |||
end | |||
|
|||
test '!update (w/o arguments) polls the twitter profile' do | |||
command('svenfuchs', '@rugb !update').run | |||
assert_profile('svenfuchs', 'twitter') | |||
end | |||
|
|||
test '!update twitter:svenfuchs polls the twitter profile' do | |||
command('svenfuchs', '@rugb !update twitter:svenfuchs').run | |||
assert_profile('svenfuchs', 'twitter') | |||
end | |||
|
|||
test '!update github:svenfuchs polls the twitter and github profiles' do | |||
command('svenfuchs', '@rugb !update github:svenfuchs').run | |||
assert_profiles('svenfuchs', 'twitter', 'github') | |||
end | |||
|
|||
test '!update http://github.com/svenfuchs polls the twitter and github profiles' do | |||
command('svenfuchs', '@rugb !update http://github.com/svenfuchs').run | |||
assert_profiles('svenfuchs', 'twitter', 'github') | |||
end | |||
|
|||
test '!update http://tinyurl.com/yc7t8bv polls the twitter and json profiles AND updates from github BUT NOT twitter' do | |||
source_url = Identity::Sources['github'].source_url('hax') | |||
Identity::Sources::Base.expects(:get).with(source_url).never | |||
|
|||
command('svenfuchs', '@rugb !update http://tinyurl.com/yc7t8bv').run | |||
assert_profiles('svenfuchs', 'twitter', 'json') | |||
assert_profile('svenphoox', 'github') | |||
end | |||
end | |||
|
Oops, something went wrong.