Sha256: 7bb49851f3a53aa51328f794803d9ef99f58312d678d0a546ca0afd568b579e2

Contents?: true

Size: 757 Bytes

Versions: 7

Compression:

Stored size: 757 Bytes

Contents

require "helpers/test_helper"
require File.expand_path("../../../../lib/fog/compute/google/models/server", __FILE__)

class UnitTestServer < MiniTest::Test
  def test_metadata_uses_deprecated_sshKeys_if_exists
    server = Fog::Compute::Google::Server.new(:metadata => { "sshKeys" => "existing_user:existing_key" })
    server.add_ssh_key("my_username", "my_key")

    assert_match(/my_username/, server.metadata["sshKeys"])
    assert_match(/my_key/, server.metadata["sshKeys"])
  end

  def test_add_ssh_key_uses_ssh_keys_by_default
    server = Fog::Compute::Google::Server.new
    server.add_ssh_key("my_username", "my_key")

    assert_match(/my_username/, server.metadata["ssh-keys"])
    assert_match(/my_key/, server.metadata["ssh-keys"])
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fog-google-0.6.0 test/unit/compute/test_server.rb
fog-google-0.5.5 test/unit/compute/test_server.rb
fog-google-0.5.4 test/unit/compute/test_server.rb
fog-google-0.5.3 test/unit/compute/test_server.rb
fog-google-0.5.2 test/unit/compute/test_server.rb
fog-google-0.5.1 test/unit/compute/test_server.rb
fog-google-0.5.0 test/unit/compute/test_server.rb