podcast/enclosure_test.go

38 lines
755 B
Go
Raw Permalink Normal View History

2017-02-02 07:42:33 -05:00
package podcast_test
import (
"testing"
"github.com/arenzana/podcast"
2017-02-02 07:42:33 -05:00
"github.com/stretchr/testify/assert"
)
2017-02-04 13:15:18 -05:00
type enclosureTest struct {
t podcast.EnclosureType
expected string
2017-02-02 07:42:33 -05:00
}
2017-02-04 13:15:18 -05:00
var enclosureTests = []enclosureTest{
{podcast.M4A, "audio/x-m4a"},
{podcast.M4V, "video/x-m4v"},
{podcast.MP4, "video/mp4"},
{podcast.MP3, "audio/mpeg"},
{podcast.MOV, "video/quicktime"},
{podcast.PDF, "application/pdf"},
{podcast.EPUB, "document/x-epub"},
{podcast.M4A, "audio/x-m4a"},
{99, "application/octet-stream"},
2017-02-02 07:42:33 -05:00
}
2017-02-04 13:15:18 -05:00
func TestEnclosureTypes(t *testing.T) {
2017-02-02 07:42:33 -05:00
t.Parallel()
2017-02-04 13:15:18 -05:00
for _, et := range enclosureTests {
et := et
t.Run(et.t.String(), func(t *testing.T) {
t.Parallel()
2017-02-02 07:42:33 -05:00
2017-02-04 13:15:18 -05:00
assert.EqualValues(t, et.expected, et.t.String())
})
}
2017-02-02 07:42:33 -05:00
}