Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Commit

Permalink
100% coverage again
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Aug 17, 2016
1 parent f17ae54 commit 3a1e466
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions project/project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package project_test

import (
"os"
"path/filepath"
"testing"

"github.com/getantibody/antibody/project"
Expand Down Expand Up @@ -51,3 +52,17 @@ func TestUpdateHome(t *testing.T) {
assert.NoError(project.NewGit(home, "caarlos0/ports", "master").Download())
assert.NoError(project.Update(home))
}

func TestUpdateNonExistentHome(t *testing.T) {
assert.Error(t, project.Update("/tmp/asdasdasdasksksksksnopeeeee"))
}

func TestUpdateHomeWithNoGitProjects(t *testing.T) {
assert := assert.New(t)
home := home()
defer os.RemoveAll(home)
repo := project.NewGit(home, "caarlos0/jvm", "master")
assert.NoError(repo.Download())
os.RemoveAll(filepath.Join(repo.Folder(), ".git"))
assert.Error(project.Update(home))
}

0 comments on commit 3a1e466

Please sign in to comment.