1
0
Fork 0
mirror of https://github.com/Luzifer/ansible-role-version.git synced 2024-12-23 11:01:20 +00:00
ansible-role-version/vendor/gopkg.in/src-d/go-git.v4/options_test.go
Knut Ahlers 209b813c5b
Update dependencies
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2018-03-19 18:16:10 +01:00

35 lines
748 B
Go

package git
import (
. "gopkg.in/check.v1"
"gopkg.in/src-d/go-git.v4/plumbing/object"
)
type OptionsSuite struct {
BaseSuite
}
var _ = Suite(&OptionsSuite{})
func (s *OptionsSuite) TestCommitOptionsParentsFromHEAD(c *C) {
o := CommitOptions{Author: &object.Signature{}}
err := o.Validate(s.Repository)
c.Assert(err, IsNil)
c.Assert(o.Parents, HasLen, 1)
}
func (s *OptionsSuite) TestCommitOptionsMissingAuthor(c *C) {
o := CommitOptions{}
err := o.Validate(s.Repository)
c.Assert(err, Equals, ErrMissingAuthor)
}
func (s *OptionsSuite) TestCommitOptionsCommitter(c *C) {
sig := &object.Signature{}
o := CommitOptions{Author: sig}
err := o.Validate(s.Repository)
c.Assert(err, IsNil)
c.Assert(o.Committer, Equals, o.Author)
}