Sha256: ca71ac8c3a5ee060a4baa133d56bba8ce4c1b618a896e073ab17ac9106cd9b7b

Contents?: true

Size: 1.93 KB

Versions: 28

Compression:

Stored size: 1.93 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,
                     :memory,
                     :cores,
                     :cpu_shares,
                     :hostname,
                     :image,
                     :attach_stdin,
                     :attach_stdout,
                     :attach_stderr,
                     :state_exit_code,
                     :state_pid,
                     :port_bindings,
                     :links,
                     :privileged,
                     :tty,
                     :exposed_ports,
                     :volumes,
                     :environment_variables
      ]
      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

28 entries across 26 versions & 4 rubygems

Version Path
fog-2.3.0 tests/fogdocker/models/compute/server_tests.rb
fog-ifeel-2.2.0 tests/fogdocker/models/compute/server_tests.rb
fog-2.2.0 tests/fogdocker/models/compute/server_tests.rb
fog-2.1.0 tests/fogdocker/models/compute/server_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/tests/fogdocker/models/compute/server_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/tests/fogdocker/models/compute/server_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/tests/fogdocker/models/compute/server_tests.rb
fog-1.42.1 tests/fogdocker/models/compute/server_tests.rb
fog-2.0.0 tests/fogdocker/models/compute/server_tests.rb
fog-1.42.0 tests/fogdocker/models/compute/server_tests.rb
fog-1.41.0 tests/fogdocker/models/compute/server_tests.rb
fog-1.40.0 tests/fogdocker/models/compute/server_tests.rb
fog-1.39.0 tests/fogdocker/models/compute/server_tests.rb
fog-1.38.0 tests/fogdocker/models/compute/server_tests.rb
fog-1.37.0 tests/fogdocker/models/compute/server_tests.rb
fog-1.36.0 tests/fogdocker/models/compute/server_tests.rb
fog-1.35.0 tests/fogdocker/models/compute/server_tests.rb
fog-2.0.0.pre.0 tests/fogdocker/models/compute/server_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/fogdocker/models/compute/server_tests.rb
fog-1.34.0 tests/fogdocker/models/compute/server_tests.rb