Skip to content

Commit

Permalink
adding in a test for builder.Close()
Browse files Browse the repository at this point in the history
  • Loading branch information
zabawaba99 committed Aug 6, 2015
1 parent 06561f8 commit 73b63e1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions builder_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
package main

import (
"github.com/stretchr/testify/assert"

"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestNewBuilder(t *testing.T) {
b, err := NewBuilder(config{})
assert.NoError(t, err)
assert.NotNil(t, b)
}

func TestClose(t *testing.T) {
b, err := NewBuilder(config{})
require.NoError(t, err)

b.Close()

_, ok := <-b.done
assert.False(t, ok, "channel 'done' was not closed")
}

0 comments on commit 73b63e1

Please sign in to comment.