Sha256: 609d075176735153b1bde2e80a43263add54c6f757517559081dee4c42763d7f

Contents?: true

Size: 756 Bytes

Versions: 3

Compression:

Stored size: 756 Bytes

Contents

require 'spec_helper'
require 'torrent_client'
describe VideoTorrentInfo::TorrentClient do
  let(:target) { '/tmp/RIPD.3D.2013.BDRip1080p.halfOU(Killbrain)_[scarabey.org].mkv' }
  subject { VideoTorrentInfo::TorrentClient.new }
  context 'when #load' do
    context 'with wrong file' do
      specify do
        expect { subject.load('abra', 0, 1000000, 'cadabra', 8661, 8662) }.to raise_error('failed to load torrent info: No such file or directory')
      end
    end
    context 'with good file' do
      before do
        subject.load('spec/fixtures/test.torrent', 0, 1000000, '/tmp', 8661, 8662)
      end
      after do 
        File.unlink(target)
      end
      specify do
        expect(File.exist?(target)).to be_true
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
video-torrent-info-0.1.8 spec/lib/torrent_client_spec.rb
video-torrent-info-0.1.6 spec/lib/torrent_client_spec.rb
video-torrent-info-0.1.5 spec/lib/torrent_client_spec.rb