Sha256: bf209a12ffc6b095ad9c142f4b6199acd4df2411a64981de4c966ff0cdb52fe8

Contents?: true

Size: 1.55 KB

Versions: 14

Compression:

Stored size: 1.55 KB

Contents

Shindo.tests('Fog::Compute[:fogdocker] | server model', ['fogdocker']) do

  compute = Fog::Compute[:fogdocker]
  server = compute.servers.create(:name => "fog-#{Time.now.to_i}", 'image' => 'mattdm/fedora:f19','Cmd' => ['date'])

  tests('The server model should') do
    tests('have the action') do
      test('reload') { server.respond_to? 'reload' }
      %w{ start restart stop commit destroy}.each do |action|
        test(action) { server.respond_to? action }
      end
      %w{ start restart stop commit destroy}.each do |action|
        test("#{action} returns successfully") {
          server.send(action.to_sym) ? true : false
        }
      end
    end
    tests('have attributes') do
      model_attribute_hash = server.attributes
      attributes = [ :id,
                     :name,
                     :created,
                     :ipaddress,
                     :state_running,
                     :cores,
                     :memory,
                     :hostname,
                     :image,
                     #:exposed_ports,
                     #:volumes
      ]
      tests("The server model should respond to") do
        attributes.each do |attribute|
          test("#{attribute}") { server.respond_to? attribute }
        end
      end
      tests("The attributes hash should have key") do
        attributes.each do |attribute|
          test("#{attribute}") { model_attribute_hash.key? attribute }
        end
      end
    end
    test('be a kind of Fog::Compute::Fogdocker::Server') { server.kind_of? Fog::Compute::Fogdocker::Server }
  end

end

Version data entries

14 entries across 14 versions & 4 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/fogdocker/models/compute/server_tests.rb
nsidc-fog-1.24.1 tests/fogdocker/models/compute/server_tests.rb
fog-1.24.0 tests/fogdocker/models/compute/server_tests.rb
ns-fog-1.22.11 tests/fogdocker/models/compute/server_tests.rb
ns-fog-1.22.10 tests/fogdocker/models/compute/server_tests.rb
ns-fog-1.22.9 tests/fogdocker/models/compute/server_tests.rb
ns-fog-1.22.8 tests/fogdocker/models/compute/server_tests.rb
ns-fog-1.22.7 tests/fogdocker/models/compute/server_tests.rb
ns-fog-1.22.6 tests/fogdocker/models/compute/server_tests.rb
fog-1.23.0 tests/fogdocker/models/compute/server_tests.rb
ns-fog-1.22.4 tests/fogdocker/models/compute/server_tests.rb
ns-fog-1.22.3 tests/fogdocker/models/compute/server_tests.rb
ns-fog-1.22.2 tests/fogdocker/models/compute/server_tests.rb
fog-1.22.1 tests/fogdocker/models/compute/server_tests.rb