aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/bug_test.go (renamed from test/bug_test.go)18
-rw-r--r--tests/operation_iterator_test.go (renamed from test/operation_iterator_test.go)13
2 files changed, 18 insertions, 13 deletions
diff --git a/test/bug_test.go b/tests/bug_test.go
index d7c3ddc5..dfb3ac09 100644
--- a/test/bug_test.go
+++ b/tests/bug_test.go
@@ -1,21 +1,23 @@
-package test
+package tests
import (
"github.com/MichaelMure/git-bug/bug"
- "github.com/MichaelMure/git-bug/bug/operations"
"testing"
)
-func TestBug(t *testing.T) {
- var rene = bug.Person{
- Name: "René Descartes",
- Email: "rene@descartes.fr",
+func TestBugId(t *testing.T) {
+ bug1, err := bug.NewBug()
+ if err != nil {
+ t.Error(err)
}
- var createOp = operations.NewCreateOp(rene, "title", "message")
+ if len(bug1.HumanId()) == 0 {
+ t.Fatal("Bug doesn't have a human readable identifier")
+ }
+}
+func TestBugValidity(t *testing.T) {
bug1, err := bug.NewBug()
-
if err != nil {
t.Error(err)
}
diff --git a/test/operation_iterator_test.go b/tests/operation_iterator_test.go
index d8e78a1f..e41fff99 100644
--- a/test/operation_iterator_test.go
+++ b/tests/operation_iterator_test.go
@@ -1,4 +1,4 @@
-package test
+package tests
import (
"github.com/MichaelMure/git-bug/bug"
@@ -6,14 +6,17 @@ import (
"testing"
)
-func TestOpIterator(t *testing.T) {
- var rene = bug.Person{
+var (
+ rene = bug.Person{
Name: "René Descartes",
Email: "rene@descartes.fr",
}
- var createOp = operations.NewCreateOp(rene, "title", "message")
- var setTitleOp = operations.NewSetTitleOp("title2")
+ createOp = operations.NewCreateOp(rene, "title", "message")
+ setTitleOp = operations.NewSetTitleOp("title2")
+)
+
+func TestOpIterator(t *testing.T) {
bug1, err := bug.NewBug()