Sha256: 29dbddce3ef7e1265a1f88508de81d2acfad2f05b79a0a988034a38c34ebe2e0

Contents?: true

Size: 979 Bytes

Versions: 11

Compression:

Stored size: 979 Bytes

Contents

require "time"
require "date"

class TestRole < Test::Unit::TestCase
  def test_server_aggregates
    params = {
      "availability_zone" => "nova",
      "deleted" => false,
      "hosts" => ["host1", "host2"],
      "metadata" => {"foo" => "bar"},
      "name" => "nova",
      "created_at" => "2015-08-27T09:49:58-05:00",
      "updated_at" => "2015-08-27T09:49:58-05:00",
      "deleted_at" => "2015-08-27T09:49:58-05:00",
    }

    aggregates = Yao::Aggregates.new(params)
    assert_equal(aggregates.availability_zone, "nova")
    assert_equal(aggregates.deleted, false)
    assert_equal(aggregates.hosts, ["host1", "host2"])
    assert_equal(aggregates.metadata, {"foo" => "bar"})
    assert_equal(aggregates.name, "nova")
    assert_equal(aggregates.created, Time.parse("2015-08-27T09:49:58-05:00"))
    assert_equal(aggregates.updated, Time.parse("2015-08-27T09:49:58-05:00"))
    assert_equal(aggregates.deleted_at, Date.parse("2015-08-27T09:49:58-05:00"))
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
yao-0.6.3 test/yao/resources/test_aggregates.rb
yao-0.6.2 test/yao/resources/test_aggregates.rb
yao-0.6.1 test/yao/resources/test_aggregates.rb
yao-0.6.0 test/yao/resources/test_aggregates.rb
yao-0.5.0 test/yao/resources/test_aggregates.rb
yao-0.4.3 test/yao/resources/test_aggregates.rb
yao-0.4.2 test/yao/resources/test_aggregates.rb
yao-0.4.1 test/yao/resources/test_aggregates.rb
yao-0.4.0 test/yao/resources/test_aggregates.rb
yao-0.3.8 test/yao/resources/test_aggregates.rb
yao-0.3.7 test/yao/resources/test_aggregates.rb