Sha256: 824bab73ab083b51d9ff75d59abb973c814c0dc4592d170418b7de0e77aead72

Contents?: true

Size: 1.58 KB

Versions: 60

Compression:

Stored size: 1.58 KB

Contents

#
# Author:: Matt Eldridge (<matt.eldridge@us.ibm.com>)
# © Copyright IBM Corporation 2014.
#
# LICENSE: MIT (http://opensource.org/licenses/MIT)
#

Shindo.tests("Fog::Storage[:softlayer] | File model", ["softlayer"]) do
  pending unless Fog.mocking?

  tests("success") do

    @storage = Fog::Storage[:softlayer]
    @test_dir1 = @storage.directories.create(:key => 'test-container-1')
    @test_dir2 = @storage.directories.create(:key => 'test-container-2')
    @test_file1 = 'test-object-1'
    @test_file2 = 'test-object-2'
    @test_file3 = 'test-object-3'

    tests("#create") do
      data_matches_schema(Fog::Storage::Softlayer::File) { @test_dir1.files.create(:key => @test_file1) }
      data_matches_schema(Fog::Storage::Softlayer::File) { @test_dir1.files.create(:key => @test_file2) }
    end

    tests("#all") do
      schema = [
          Fog::Storage::Softlayer::File,
          Fog::Storage::Softlayer::File
      ]
      data_matches_schema(schema) { @test_dir1.files.all }
    end

    tests("#get") do
      data_matches_schema(Fog::Storage::Softlayer::File) { @test_dir1.files.get(@test_file1) }
    end

    tests("#copy") do
      data_matches_schema(Fog::Storage::Softlayer::File) { @test_dir1.files.get(@test_file1).copy(@test_dir2, @test_file1)}
      data_matches_schema(Fog::Storage::Softlayer::File) { @test_dir2.files.get(@test_file1) }
    end

    tests("#destroy") do
      data_matches_schema(true) { @test_dir1.files.get(@test_file1).destroy }
    end

  end


  tests ("failure") do

    tests("#create").raises(ArgumentError) do
      @test_dir1.files.create
    end

  end
end

Version data entries

60 entries across 58 versions & 3 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-softlayer-1.1.4/tests/softlayer/models/storage/file_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-softlayer-1.1.4/tests/softlayer/models/storage/file_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-softlayer-1.1.4/tests/softlayer/models/storage/file_tests.rb
fog-softlayer-1.1.4 tests/softlayer/models/storage/file_tests.rb
fog-softlayer-1.1.3 tests/softlayer/models/storage/file_tests.rb
fog-softlayer-1.1.2 tests/softlayer/models/storage/file_tests.rb
fog-softlayer-1.1.1 tests/softlayer/models/storage/file_tests.rb
fog-softlayer-1.1.0 tests/softlayer/models/storage/file_tests.rb
fog-softlayer-1.0.3 tests/softlayer/models/storage/file_tests.rb
fog-softlayer-1.0.2 tests/softlayer/models/storage/file_tests.rb
fog-softlayer-1.0.1 tests/softlayer/models/storage/file_tests.rb
fog-softlayer-1.0.0 tests/softlayer/models/storage/file_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-softlayer-0.4.7/tests/softlayer/models/storage/file_tests.rb
fog-softlayer-0.4.7 tests/softlayer/models/storage/file_tests.rb
fog-softlayer-0.4.6 tests/softlayer/models/storage/file_tests.rb
fog-softlayer-0.4.5 tests/softlayer/models/storage/file_tests.rb
fog-softlayer-0.4.4 tests/softlayer/models/storage/file_tests.rb
fog-softlayer-0.4.3 tests/softlayer/models/storage/file_tests.rb
fog-softlayer-0.4.2 tests/softlayer/models/storage/file_tests.rb
fog-softlayer-0.4.2.pre tests/softlayer/models/storage/file_tests.rb