Sha256: 40da15c5a9ba34808a0383cdd3544803b5db0df7fcb2a4b35b3b2d649339cf29

Contents?: true

Size: 1.1 KB

Versions: 3

Compression:

Stored size: 1.1 KB

Contents

require 'helper'

class TestMusicbrainzRelease < Test::Unit::TestCase
  context "release" do
    should "load xml" do
      assert_nothing_raised(Exception) do
        MusicBrainz::Release.find('2225dd4c-ae9a-403b-8ea0-9e05014c778f')
      end
    end
  
    setup do
      @release = MusicBrainz::Release.find('2225dd4c-ae9a-403b-8ea0-9e05014c778f')
    end
  
    should "return valid instance" do
      assert_instance_of(MusicBrainz::Release, @release)
    end
  
    should "contain correct data" do
      assert_equal("2225dd4c-ae9a-403b-8ea0-9e05014c778f", @release.id)
      assert_equal("Empire", @release.title)
      assert_equal("Official", @release.status)
      assert_equal(Time.utc(2006, 8, 28), @release.date)
      assert_equal("GB", @release.country)
    end
  
    should "load tracks" do
      tracks = @release.tracks
      assert_equal(11, tracks.length)
      assert_equal(1, tracks.first.position)
      assert_equal('b3015bab-1540-4d4e-9f30-14872a1525f7', tracks.first.recording_id)
      assert_equal('Empire', tracks.first.title)
      assert_equal(233013, tracks.first.length)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
musicbrainz-0.5.2 test/test_musicbrainz_release.rb
musicbrainz-0.5.1 test/test_musicbrainz_release.rb
musicbrainz-0.5.0 test/test_musicbrainz_release.rb