Sha256: 771e37d2c1086f70f3e0b2337d875c84645d2f0d526fb78ed488d0becd8dc648

Contents?: true

Size: 738 Bytes

Versions: 4

Compression:

Stored size: 738 Bytes

Contents

require 'spec_helper'

describe Somadic::Mplayer do
  it 'can start and stop mplayer' do
    mp = Somadic::Mplayer.new({ url: 'http://listen.di.fm/public3/breaks.pls' })
    expect(mp.cache).to be nil
    expect(mp.cache_min).to be nil
    if pidlist.empty?
      mp.start
      sleep secs_to_wait # let it spin up
      expect(pidlist.count).to be > 0

      mp.stop
      sleep secs_to_wait / 2 # let it die
      expect(pidlist.empty?).to be true
    else
      puts "\n!!! mplayer is already running, skipping test."
    end
  end

  it 'sets cache options correctly' do
    mp = Somadic::Mplayer.new({ url: 'http://ghost.com', cache: 999, cache_min: 90 })
    expect(mp.cache).to eql 999
    expect(mp.cache_min).to eql 90
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
somadic-0.0.4 spec/lib/somadic/mplayer_spec.rb
somadic-0.0.3 spec/lib/somadic/mplayer_spec.rb
somadic-0.0.2 spec/lib/somadic/mplayer_spec.rb
somadic-0.0.1 spec/lib/somadic/mplayer_spec.rb