Sha256: 6c3f94f5873bb440a37eeaed4cdc78de984a22a91b5c2826d8a0c42473b7d10f

Contents?: true

Size: 932 Bytes

Versions: 3

Compression:

Stored size: 932 Bytes

Contents

require_relative '../helper'

require 'grooveshark'

describe Grooveshark::Broadcast do
  let(:client) { Grooveshark::Client.new }

  describe 'search' do
    let(:result) { client.top_broadcasts(10) }

    it 'returns an array' do
      expect(result).to be_an Array
      expect(result.size).to eq 10
    end

    it 'includes brodcasts' do
      all = result.all? { |item| item.is_a?(Grooveshark::Broadcast) }
      expect(all).to be_truthy
    end
  end

  describe 'broadcast' do
    let(:broadcast) { client.top_broadcasts.first }

    it 'has a valid id' do
      expect(broadcast.id).to match(/^[abcdef\d]{24}$/i)
    end

    describe '#active_song' do
      it 'is a song instance' do
        expect(broadcast.active_song).to be_a Grooveshark::Song
      end
    end

    describe '#next_song' do
      it 'is a song instance' do
        expect(broadcast.active_song).to be_a Grooveshark::Song
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
grooveshark-0.2.14 spec/grooveshark/broadcast_spec.rb
grooveshark-0.2.13 spec/grooveshark/broadcast_spec.rb
grooveshark-0.2.12 spec/grooveshark/broadcast_spec.rb