flesh out tests with some mocking (yuck)

This commit is contained in:
Will Farrington
2013-02-13 19:50:21 -08:00
parent 97b6366e8f
commit e06fab1128

View File

@@ -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