2014-06-04 17:40:09 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2015-01-30 19:08:47 +00:00
|
|
|
"github.com/hawser/git-hawser/hawser"
|
2014-06-04 17:40:09 +00:00
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestVersionOnEmptyRepository(t *testing.T) {
|
|
|
|
repo := NewRepository(t, "empty")
|
2014-06-04 18:57:20 +00:00
|
|
|
defer repo.Test()
|
|
|
|
|
2014-06-04 17:44:07 +00:00
|
|
|
repo.AddPath(repo.Path, ".git")
|
|
|
|
repo.AddPath(repo.Path, "subdir")
|
2014-06-04 17:40:09 +00:00
|
|
|
|
|
|
|
cmd := repo.Command("version")
|
2015-01-30 18:13:15 +00:00
|
|
|
cmd.Output = hawser.UserAgent
|
2014-06-04 17:40:09 +00:00
|
|
|
|
2014-06-26 21:00:51 +00:00
|
|
|
cmd = repo.Command("version", "--comics")
|
2015-01-30 18:13:15 +00:00
|
|
|
cmd.Output = fmt.Sprintf("%s\nNothing may see Gah Lak Tus and survive!", hawser.UserAgent)
|
2014-06-26 21:00:51 +00:00
|
|
|
|
|
|
|
cmd = repo.Command("version", "-c")
|
2015-01-30 18:13:15 +00:00
|
|
|
cmd.Output = fmt.Sprintf("%s\nNothing may see Gah Lak Tus and survive!", hawser.UserAgent)
|
2014-06-04 17:40:09 +00:00
|
|
|
}
|