require 'spec_helper' describe Lifen::Binary do describe ':download with right uuid' do let(:binary) { Lifen::Binary.new(uuid: "valid_binary_id") } it 'works' do VCR.use_cassette "binary/download/valid" do expect(Digest::MD5.hexdigest(binary.download)).to eq("2285abb032c5e9054a518690b4701ab6") end end end describe ':download with right uuid' do let(:binary) { Lifen::Binary.new(uuid: "wrong-binary-uuid") } it 'fails with wrong uuid' do VCR.use_cassette "binary/download/invalid" do expect{ binary.download }.to raise_error Lifen::Error end end end end