-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #697 from alyssais/commit_sig_key_error
Use Hash#fetch instead of Hash#[] for more understandable error messages
- Loading branch information
Showing
2 changed files
with
14 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -452,6 +452,18 @@ def test_write_empty_email_fails | |
end | ||
end | ||
|
||
def test_write_signature_raises_key_error_for_missing_keys | ||
person = {:name => 'Jake', :time => Time.now} # no :email | ||
assert_raises KeyError do | ||
Rugged::Commit.create(@repo, | ||
:message => "This is the commit message\n\nThis commit is created from Rugged", | ||
:committer => person, | ||
:author => person, | ||
:parents => [@repo.head.target], | ||
:tree => "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b") | ||
end | ||
end | ||
|
||
def test_create_commit_to_s | ||
person = {:name => 'Scott', :email => '[email protected]', :time => Time.now } | ||
|
||
|