Sha256: 96e16a4cbee90e71b5ce39fbd6ab4174a56d69a514d41a5bc742a7f99f603970

Contents?: true

Size: 878 Bytes

Versions: 5

Compression:

Stored size: 878 Bytes

Contents

require 'spec_helper'
require 'adapter/mpd/playlist_parser'

describe Radiodan::MPD::PlaylistParser do
  before :all do
    @attributes = { "volume"=>"57", "repeat"=>"1", "random"=>"1", "single"=>"0", "consume"=>"0", "playlist"=>"3", 
                    "playlistlength"=>"1", "xfade"=>"0", "mixrampdb"=>"0.000000", "mixrampdelay"=>"nan", "state"=>"pause", 
                    "song"=>"0", "songid"=>"2", "time"=>"0:0", "elapsed"=>"214.599", "bitrate"=>"0", "audio"=>"0:?:0" }
  end
  
  it 'creates matching playlist object' do
    playlist = subject.parse(@attributes, [file: '1'])
    
    playlist.state.should     == :pause
    playlist.mode.should      == :random
    playlist.repeat.should    == true
    playlist.tracks.should    == [file: '1']
    playlist.position.should  == 0
    playlist.seek.should      == 214.599
    playlist.volume.should    == 57
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
radiodan-1.0.1 spec/lib/playlist_parser_spec.rb
radiodan-1.0.0 spec/lib/playlist_parser_spec.rb
radiodan-0.0.4 spec/lib/playlist_parser_spec.rb
radiodan-0.0.3 spec/lib/playlist_parser_spec.rb
radiodan-0.0.2 spec/lib/playlist_parser_spec.rb