Sha256: 18a4c3133f5205869f9e97879a564bfdfece4c03f1176301be327bbab4b10d47

Contents?: true

Size: 1.38 KB

Versions: 15

Compression:

Stored size: 1.38 KB

Contents

# rubocop:disable Metrics/BlockLength
Shindo.tests("Fog::Compute[:ovirt] | server model", ["ovirt"]) do
  servers = Fog::Compute[:ovirt].servers
  server = servers.last

  tests("The server model should") do
    tests("have the action") do
      test("reload") { server.respond_to? "reload" }
      %w[start stop destroy reboot suspend].each do |action|
        test(action) { server.respond_to? action }
      end
      %w[start reboot suspend stop].each do |action|
        test("#{action} returns successfully") do
          server.send(action.to_sym) ? true : false
        end
      end
    end
    tests("have attributes") do
      model_attribute_hash = server.attributes
      attributes = %i[
        id
        name
        description
        profile
        display
        creation_time
        os
        status
        cores
        memory
        cluster
        template
      ]
      tests("The server model should respond to") do
        attributes.each do |attribute|
          test(attribute.to_s) { server.respond_to? attribute }
        end
      end
      tests("The attributes hash should have key") do
        attributes.each do |attribute|
          test(attribute.to_s) { model_attribute_hash.key? attribute }
        end
      end
    end
    test("be a kind of Fog::Compute::Ovirt::Server") { server.is_a? Fog::Compute::Ovirt::Server }
  end
end
# rubocop:enable Metrics/BlockLength

Version data entries

15 entries across 13 versions & 2 rubygems

Version Path
fog-ovirt-1.1.6 tests/ovirt/models/compute/server_tests.rb
fog-ovirt-1.1.5 tests/ovirt/models/compute/server_tests.rb
fog-ovirt-1.1.4 tests/ovirt/models/compute/server_tests.rb
fog-ovirt-1.1.3 tests/ovirt/models/compute/server_tests.rb
fog-ovirt-1.1.2 tests/ovirt/models/compute/server_tests.rb
fog-ovirt-1.1.1 tests/ovirt/models/compute/server_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-ovirt-1.1.0/tests/ovirt/models/compute/server_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-ovirt-1.1.0/tests/ovirt/models/compute/server_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-ovirt-1.1.0/tests/ovirt/models/compute/server_tests.rb
fog-ovirt-1.1.0 tests/ovirt/models/compute/server_tests.rb
fog-ovirt-1.0.4 tests/ovirt/models/compute/server_tests.rb
fog-ovirt-1.0.3 tests/ovirt/models/compute/server_tests.rb
fog-ovirt-1.0.2 tests/ovirt/models/compute/server_tests.rb
fog-ovirt-1.0.1 tests/ovirt/models/compute/server_tests.rb
fog-ovirt-1.0.0 tests/ovirt/models/compute/server_tests.rb