Sha256: f9413b52ed5156ef776ea718e6f679e19f48c3c3d0e4a68e8c58c8fe874655b8

Contents?: true

Size: 1.05 KB

Versions: 3

Compression:

Stored size: 1.05 KB

Contents

Shindo.tests('Local | storage') do

  pending if Fog.mocking?

  before do
    @options = { :local_root => Dir.mktmpdir('fog-tests') }
  end

  after do
    FileUtils.remove_entry_secure @options[:local_root]
  end

  tests('#endpoint') do
    tests('when no endpoint is provided').
      returns(nil) do
        Fog::Local::Storage.new(@options).endpoint
      end

    tests('when no host is provided').
      returns(nil) do
        @options[:scheme] = 'http'
        @options[:path] = '/files'
        @options[:port] = 80

        Fog::Local::Storage.new(@options).endpoint
      end

    tests('when endpoint is provided').
      returns('http://example.com/files') do
        @options[:endpoint] = 'http://example.com/files'

        Fog::Local::Storage.new(@options).endpoint
      end

    tests('when at least host option is provided').
      returns('http://example.com/files') do
        @options[:scheme] = 'http'
        @options[:host] = 'example.com'
        @options[:path] = '/files'

        Fog::Local::Storage.new(@options).endpoint
      end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-local-0.8.0 tests/local/storage_tests.rb
fog-local-0.7.0 tests/local/storage_tests.rb
fog-local-0.6.0 tests/local/storage_tests.rb