Sha256: ed800f45808747c68d1a3d1dfc4d9cc928861f781b9fd5820cae701d3cba200c

Contents?: true

Size: 968 Bytes

Versions: 3

Compression:

Stored size: 968 Bytes

Contents

require 'spec_helper'

describe Lobber do
  it "exists as a module" do
    Lobber.class.should eq Module
  end

  describe ".upload" do
    before :each do
      @uploader_double = double(Lobber::Uploader)
    end

    context "it is only passed a directory name, and not an S3 bucket name" do
      it "verifies environment variables and uploads the directory and its contents to S3" do
        Lobber::Uploader.should_receive(:new).with('foo', nil).and_return(@uploader_double)
        @uploader_double.should_receive(:upload)

        Lobber.upload 'foo'
      end
    end

    context "it is passed a directory name and an S3 bucket name" do
      it "verifies environment variables and uploads the directory and its contents to the specified S3 bucket" do
        Lobber::Uploader.should_receive(:new).with('foo', 'bar').and_return(@uploader_double)
        @uploader_double.should_receive(:upload)

        Lobber.upload 'foo', 'bar'
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lobber-0.0.4 spec/lib/lobber_spec.rb
lobber-0.0.3 spec/lib/lobber_spec.rb
lobber-0.0.2 spec/lib/lobber_spec.rb