git-lfs/commands/ls_files_test.go
2015-01-30 14:42:46 -05:00

30 lines
649 B
Go

package commands
import (
"path/filepath"
"testing"
)
func TestLsFiles(t *testing.T) {
repo := NewRepository(t, "empty")
defer repo.Test()
cmd := repo.Command("ls-files")
cmd.Output = "a.dat"
cmd.Before(func() {
path := filepath.Join(".git", "info", "attributes")
repo.WriteFile(path, "*.dat filter=hawser -crlf\n")
// Add a hawser file
repo.WriteFile(filepath.Join(repo.Path, "a.dat"), "some data")
repo.GitCmd("add", "a.dat")
repo.GitCmd("commit", "-m", "a")
// Add a regular file
repo.WriteFile(filepath.Join(repo.Path, "hi.txt"), "some text")
repo.GitCmd("add", "hi.txt")
repo.GitCmd("commit", "-m", "hi")
})
}