Sha256: 342bbd424effd664d63a66afd1d869a3b6f29e612f89988eaabb8a6299c88200

Contents?: true

Size: 986 Bytes

Versions: 6

Compression:

Stored size: 986 Bytes

Contents

require 'spec_helper'

describe Kagu::Library do

  let(:library) { Kagu::Library.new }

  describe '#initialize' do

    it 'is correct by default' do
      expect(library.path).to eq("#{ENV['HOME']}/Music/iTunes/iTunes Music Library.xml")
    end

    it 'raise an error if directory' do
      expect {
        Kagu::Library.new('/tmp')
      }.to raise_error(Kagu::Error, 'No such file: "/tmp"')
    end

    it "raise an error if file can't be found" do
      expect {
        Kagu::Library.new('/tmp/bar.foo.baz')
      }.to raise_error(Kagu::Error, 'No such file: "/tmp/bar.foo.baz"')
    end

  end

  describe '#playlists' do

    it 'returns a Playlists object' do
      expect(library.playlists).to be_a(Kagu::Playlists)
      expect(library.playlists.library).to be(library)
    end

  end

  describe '#tracks' do

    it 'returns a Tracks object' do
      expect(library.tracks).to be_a(Kagu::Tracks)
      expect(library.tracks.library).to be(library)
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
kagu-0.3.3 spec/kagu/library_spec.rb
kagu-0.3.2 spec/kagu/library_spec.rb
kagu-0.3.1 spec/kagu/library_spec.rb
kagu-0.3.0 spec/kagu/library_spec.rb
kagu-0.2.0 spec/kagu/library_spec.rb
kagu-0.1.1 spec/kagu/library_spec.rb