mirror of
https://github.com/zhigang1992/boxen.git
synced 2026-01-12 17:12:46 +08:00
flesh out tests with some mocking (yuck)
This commit is contained in:
@@ -6,7 +6,23 @@ class BoxenKeychainTest < Boxen::Test
|
||||
@keychain = Boxen::Keychain.new('test')
|
||||
end
|
||||
|
||||
def test_true
|
||||
assert true
|
||||
def test_get_password
|
||||
@keychain.expects(:get).with('GitHub Password').returns('foobar')
|
||||
assert_equal 'foobar', @keychain.password
|
||||
end
|
||||
|
||||
def test_set_password
|
||||
@keychain.expects(:set).with('GitHub Password', 'foobar').returns('foobar')
|
||||
assert_equal 'foobar', @keychain.password=('foobar')
|
||||
end
|
||||
|
||||
def test_get_token
|
||||
@keychain.expects(:get).with('GitHub API Token').returns('foobar')
|
||||
assert_equal 'foobar', @keychain.token
|
||||
end
|
||||
|
||||
def test_set_token
|
||||
@keychain.expects(:set).with('GitHub API Token', 'foobar').returns('foobar')
|
||||
assert_equal 'foobar', @keychain.token=('foobar')
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user