Sha256: d0a5357a66e56f6f3491171128ca3ef7e6f742d2931488de51649f0baf89f91a

Contents?: true

Size: 1.38 KB

Versions: 62

Compression:

Stored size: 1.38 KB

Contents

Shindo.tests("Fog::Compute[:aws] | monitor", ['aws']) do

  @instance = Fog::Compute[:aws].servers.new

  [:addresses, :flavor, :key_pair, :key_pair=, :volumes].each do |association|
    responds_to(association)
  end

  tests('new instance') do

    test('#monitor = true') do
      @instance.monitor = true
      @instance.attributes[:monitoring] == true
    end

    test('#monitor = false') do
      @instance.monitor = false
      @instance.attributes[:monitoring] == false
    end

  end

  tests('existing instance') do

    @instance.save

    [:id, :availability_zone, :flavor_id, :kernel_id, :image_id, :state].each do |attr|
      test("instance##{attr} should not contain whitespace") do
        nil == @instance.send(attr).match(/\s/)
      end
    end

    test('#monitor = true') do
      @instance.monitor = true
      @instance.monitoring == true
    end

    test('#monitor = false') do
      @instance.monitor = false
      @instance.monitoring == false
    end

  end

  @instance.destroy

  tests('tags') do
    @instance = Fog::Compute[:aws].servers.create(:tags => {'key' => 'value'})

    @instance.wait_for { ready? }

    tests('@instance.reload.tags').returns({'key' => 'value'}) do
      @instance.reload.tags
    end

    unless Fog.mocking?
      Fog::Compute[:aws].tags.all('resource-id' => @instance.identity).each {|tag| tag.destroy}
    end

    @instance.destroy
  end

end

Version data entries

62 entries across 62 versions & 17 rubygems

Version Path
gapinc-fog-1.12.1.2.1 tests/aws/models/compute/server_tests.rb
fog-maestrodev-1.15.0.20130927082724 tests/aws/models/compute/server_tests.rb
fog-maestrodev-1.15.0.20130829165835 tests/aws/models/compute/server_tests.rb
fog-1.15.0 tests/aws/models/compute/server_tests.rb
gapinc-fog-1.14.0 tests/aws/models/compute/server_tests.rb
fog-maestrodev-1.14.0.20130806165225 tests/aws/models/compute/server_tests.rb
fog-1.14.0 tests/aws/models/compute/server_tests.rb
fog-1.13.0 tests/aws/models/compute/server_tests.rb
gapinc-fog-1.12.1.2 tests/aws/models/compute/server_tests.rb
gapinc-fog-1.12.1.1 tests/aws/models/compute/server_tests.rb
gapinc-fog-1.12.1a tests/aws/models/compute/server_tests.rb
gapinc-fog-1.12.1 tests/aws/models/compute/server_tests.rb
fog-1.12.1 tests/aws/models/compute/server_tests.rb
fog-1.12.0 tests/aws/models/compute/server_tests.rb
hpfog-0.0.20 tests/aws/models/compute/server_tests.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/tests/aws/models/compute/server_tests.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/tests/aws/models/compute/server_tests.rb
fog-nirvanix-1.8.2 tests/aws/models/compute/server_tests.rb
fog-1.11.1 tests/aws/models/compute/server_tests.rb
fog-1.11.0 tests/aws/models/compute/server_tests.rb