Sha256: b821d5065f52be2675c4052a106ebcb3e0e258e577cd5e20dd1c0b821eafa842

Contents?: true

Size: 782 Bytes

Versions: 119

Compression:

Stored size: 782 Bytes

Contents

Shindo.tests('Fog CurrentMachine', 'core') do

  pending unless Fog.mock?

  old_excon_defaults_mock = Excon.defaults[:mock]
  Excon.defaults[:mock] = true

  tests('ip_address') do

    tests('should be thread safe') do
      Excon.stub({:method => :get, :path => '/'}, {:body => ''})

      (1..10).map {
        Thread.new { Fog::CurrentMachine.ip_address }
      }.each{ |t| t.join }
    end

    Fog::CurrentMachine.ip_address = nil
    Excon.stubs.clear

    tests('should remove trailing endline characters') do
      Excon.stub({:method => :get,  :path => '/'}, {:body => "192.168.0.1\n"})
      Fog::CurrentMachine.ip_address == '192.168.0.1'
    end

  end

  Fog::CurrentMachine.ip_address = nil
  Excon.stubs.clear
  Excon.defaults[:mock] = old_excon_defaults_mock

end

Version data entries

119 entries across 117 versions & 15 rubygems

Version Path
ns-fog-1.22.3 tests/core/current_machine_tests.rb
ns-fog-1.22.2 tests/core/current_machine_tests.rb
fog-1.22.1 tests/core/current_machine_tests.rb
fog-1.22.0 tests/core/current_machine_tests.rb
fog-1.21.0 tests/core/current_machine_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/core/current_machine_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/core/current_machine_tests.rb
fog-maestrodev-1.19.0.20140212012611 tests/core/current_machine_tests.rb
fog-1.20.0 tests/core/current_machine_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/core/current_machine_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/core/current_machine_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/core/current_machine_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/core/current_machine_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/core/current_machine_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/core/current_machine_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/core/current_machine_tests.rb
fog-1.19.0 tests/core/current_machine_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/core/current_machine_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/core/current_machine_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/core/current_machine_tests.rb