Skip to content

Commit

Permalink
Add a test for the nil case
Browse files Browse the repository at this point in the history
  • Loading branch information
tnm committed Dec 30, 2012
1 parent 4968725 commit c5de6a9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/tree_test.rb
Expand Up @@ -37,6 +37,11 @@ def test_get_entry_by_oid
assert_equal :blob, bent[:type] assert_equal :blob, bent[:type]
end end


def test_get_entry_by_oid_returns_nil_if_no_oid
nada = @tree.get_entry_by_oid("1385f264afb75a56a5bec74243be9b367ba4ca07")
assert_equal nil, nada
end

def test_get_entry_by_oid_throws_error_if_wrong_type def test_get_entry_by_oid_throws_error_if_wrong_type
assert_raises TypeError do assert_raises TypeError do
@tree.get_entry_by_oid(:not_a_string) @tree.get_entry_by_oid(:not_a_string)
Expand Down

0 comments on commit c5de6a9

Please sign in to comment.