Sha256: 9026b07ea3a6290d7614eb57a44d9b3be2412c2410c89e25fbad2bc9a57c93b7
Contents?: true
Size: 1.88 KB
Versions: 2
Compression:
Stored size: 1.88 KB
Contents
# -*- coding: utf-8 -*- require 'spec_helper' require 'grooveshark' require 'terminal-table' require 'fakefs/spec_helpers' require 'groove-dl/displayer' # Groove Dl tests module GrooveDl # Downloader test describe 'Displayer' do include FakeFS::SpecHelpers before(:each) do end it 'should initialize' do song = Grooveshark::Song.new('song_id' => 1, 'name' => 'test', 'artist_name' => 'got') displayer = Displayer.new([song], 'Songs') expect(displayer.type).to eq('Songs') expect(displayer.result.first).to be_a(Grooveshark::Song) end it 'should render songs' do song = Grooveshark::Song.new('song_id' => 1, 'name' => 'test', 'artist_name' => 'got') displayer = Displayer.new([song], 'Songs') str = '+----+-------+--------+------+ | Songs | +----+-------+--------+------+ | Id | Album | Artist | Song | +----+-------+--------+------+ | 1 | | got | test | +----+-------+--------+------+' allow(displayer).to receive(:puts) .with(str).and_return(nil) expect(displayer.render).to be_nil end it 'should render songs' do playlist = { 'playlist_id' => 1, 'name' => 'Someting', 'f_name' => 'GoT', 'num_songs' => 1 } displayer = Displayer.new([playlist], 'Playlists') str = '+----+----------+--------+----------+ | Playlists | +----+----------+--------+----------+ | Id | Nam | Author | NumSongs | +----+----------+--------+----------+ | 1 | Someting | GoT | 1 | +----+----------+--------+----------+' allow(displayer).to receive(:puts) .with(str).and_return(nil) expect(displayer.render).to be_nil end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
groove-dl-0.2.0 | spec/groove-dl/displayer_spec.rb |
groove-dl-0.1.0 | spec/groove-dl/displayer_spec.rb |