vorbis_test.go 486 B

123456789101112131415161718192021
  1. package duration_test
  2. import (
  3. "os"
  4. . "github.com/onsi/ginkgo"
  5. . "github.com/onsi/gomega"
  6. "github.com/felamaslen/gmus-backend/pkg/read/duration"
  7. _ "github.com/felamaslen/gmus-backend/pkg/testing"
  8. )
  9. var _ = Describe("Reading ogg vorbis duration", func() {
  10. It("should get the correct duration in seconds", func() {
  11. file, _ := os.Open("pkg/read/testdata/file_example_OOG_1MG.ogg")
  12. result := duration.GetSongDurationSecondsVorbis(file)
  13. Expect(result).To(Equal(74))
  14. })
  15. })