Sha256: 17c573d62102af4d4e4f55483a7f55781a1af9f7f02676579849b8e3d4761830

Contents?: true

Size: 832 Bytes

Versions: 2

Compression:

Stored size: 832 Bytes

Contents

# coding: utf-8
require 'spec_helper'
require 'taifu'

describe Taifu::Util do
  let(:util) { Taifu::Util }

  describe '.save_flv_from_url' do
    subject(:save_flv_from_url) { util.save_flv_from_url(url, flv_path)  }
    let(:url) { 'http://www.youtube.com/watch?v=foo' }
    let(:flv_path) { '/tmp/foo.flv' }
    it 'executes youtube_dl command' do
      util.should_receive(:system).with("youtube-dl -q #{url} -o #{flv_path}")
      save_flv_from_url
    end
  end

  describe '.convert_flv_to_wav' do
    subject(:convert_flv_to_wav) { util.convert_flv_to_wav(flv_path, wav_path) }
    let(:flv_path) { '/tmp/foo.flv' }
    let(:wav_path) { '/tmp/foo.wav' }

    it 'executes ffmpeg command' do
      util.should_receive(:system).with("ffmpeg -i #{flv_path} #{wav_path} 2>/dev/null")
      convert_flv_to_wav
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
taifu-0.1.1 spec/util_spec.rb
taifu-0.1.0 spec/util_spec.rb