Skip to content

Commit

Permalink
add test for file as io.ReadCloser
Browse files Browse the repository at this point in the history
  • Loading branch information
casualjim committed Dec 19, 2017
1 parent e64426d commit 6621403
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions file_test.go
@@ -1,14 +1,20 @@
package runtime

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

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

func TestFileImplementsIOReader(t *testing.T) {
var file interface{} = File{}
var file interface{} = &File{}
expected := "that File implements io.Reader"
_, ok := file.(io.Reader)
assert.True(t, ok, expected)
assert.Implements(t, new(io.Reader), file, expected)
}

func TestFileImplementsIOReadCloser(t *testing.T) {
var file interface{} = &File{}
expected := "that File implements io.ReadCloser"
assert.Implements(t, new(io.ReadCloser), file, expected)
}

0 comments on commit 6621403

Please sign in to comment.