Skip to content

Commit

Permalink
commands/files: Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mappum committed Jan 14, 2015
1 parent 0864a6b commit 7f21c47
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions commands/files/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package files

import (
"io"
"io/ioutil"
"mime/multipart"
"strings"
"testing"
Expand All @@ -10,9 +11,9 @@ import (
func TestSliceFiles(t *testing.T) {
name := "testname"
files := []File{
&ReaderFile{"file.txt", strings.NewReader("Some text!\n")},
&ReaderFile{"beep.txt", strings.NewReader("beep")},
&ReaderFile{"boop.txt", strings.NewReader("boop")},
&ReaderFile{"file.txt", ioutil.NopCloser(strings.NewReader("Some text!\n"))},
&ReaderFile{"beep.txt", ioutil.NopCloser(strings.NewReader("beep"))},
&ReaderFile{"boop.txt", ioutil.NopCloser(strings.NewReader("boop"))},
}
buf := make([]byte, 20)

Expand Down Expand Up @@ -54,7 +55,7 @@ func TestSliceFiles(t *testing.T) {

func TestReaderFiles(t *testing.T) {
message := "beep boop"
rf := &ReaderFile{"file.txt", strings.NewReader(message)}
rf := &ReaderFile{"file.txt", ioutil.NopCloser(strings.NewReader(message))}
buf := make([]byte, len(message))

if rf.IsDirectory() {
Expand Down

0 comments on commit 7f21c47

Please sign in to comment.