Sha256: 1e9d144c9c7ab2df3a0016eb5047b097d23449df2c65756bf5569deb19c8ed4b

Contents?: true

Size: 890 Bytes

Versions: 8

Compression:

Stored size: 890 Bytes

Contents

require 'spec_helper'

describe SauceWhisk::Storage, :vcr => { :cassette_name => 'storage' } do
  before do
    @file_name = 'temp.apk'
    @temp_file = Tempfile.new @file_name

    begin
      @temp_file.write 'data'
    ensure
      @temp_file.close
    end
  end

  after do
    @temp_file.unlink
  end

  it 'uploads a file with username and key' do
    storage = SauceWhisk::Storage.new username: ENV['SAUCE_USERNAME'], key: ENV['SAUCE_ACCESS_KEY']
    storage.upload @temp_file
  end

  it 'uploads a file with implicit auth' do
    storage = SauceWhisk::Storage.new
    storage.upload @temp_file
  end

  it 'lists all uploaded files' do
    storage = SauceWhisk::Storage.new
    files   = storage.files
    expect(files.length).to be > 1

    upload_successful = files.any? do |file|
      file['name'].include?(@file_name)
    end
    expect(upload_successful).to be true
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sauce_whisk-0.0.20 spec/lib/sauce_whisk/storage_spec.rb
sauce_whisk-0.0.19 spec/lib/sauce_whisk/storage_spec.rb
sauce_whisk-0.0.18 spec/lib/sauce_whisk/storage_spec.rb
sauce_whisk-0.0.17 spec/lib/sauce_whisk/storage_spec.rb
sauce_whisk-0.0.16 spec/lib/sauce_whisk/storage_spec.rb
sauce_whisk-0.0.15 spec/lib/sauce_whisk/storage_spec.rb
sauce_whisk-0.0.14 spec/lib/sauce_whisk/storage_spec.rb
sauce_whisk-0.0.13 spec/lib/sauce_whisk/storage_spec.rb