Sha256: fc8239ed42287af04031f64034102e5df337a0e9805854629e7ba0528d4d1b7d

Contents?: true

Size: 1.02 KB

Versions: 6

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'
require 'omnibus/s3_helpers'

module Omnibus
  describe S3Helpers do
    include Omnibus::S3Helpers

    context 'when #s3_configuration is not defined' do
      describe '#client' do
        it 'raises an error if it is not overridden' do
          expect { s3_configuration }.to raise_error(RuntimeError,
                                                     "You must override s3_configuration")
        end

        it 'raises an error stating that s3_configuration must be overriden' do
          expect { client }.to raise_error(RuntimeError,
                                           "You must override s3_configuration")
        end
      end
    end

    describe '#to_base64_digest' do
      it 'turns "c3b5247592ce694f7097873aa07d66fe" into "w7UkdZLOaU9wl4c6oH1m/g=="' do
        expect(to_base64_digest("c3b5247592ce694f7097873aa07d66fe")).to eql('w7UkdZLOaU9wl4c6oH1m/g==')
      end

      it 'allows a nil input without error' do
        expect(to_base64_digest(nil)).to be_nil
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
omnibus-5.4.0 spec/unit/s3_helpers_spec.rb
omnibus-5.3.0 spec/unit/s3_helpers_spec.rb
omnibus-5.2.0 spec/unit/s3_helpers_spec.rb
omnibus-5.1.0 spec/unit/s3_helpers_spec.rb
omnibus-5.0.0 spec/unit/s3_helpers_spec.rb
omnibus-4.1.0 spec/unit/s3_helpers_spec.rb