Sha256: 7ed2ffd2bad4c0e23dcd0b66ac42ba8585e61c88daae8e7f12524de3d09b3416

Contents?: true

Size: 1.23 KB

Versions: 53

Compression:

Stored size: 1.23 KB

Contents

Shindo.tests('Fog mocking', 'core') do
  before do
    @fog_was_mocked = Fog.mock?
    Fog.unmock! if @fog_was_mocked
  end

  after do
    Fog.mock! if @fog_was_mocked
  end

  tests('Fog.mock!') do
    tests('Fog.mock!').returns(true) do
      Fog.mock!
    end

    tests('Fog.mock? without Fog.mock!').returns(false) do
      Fog.mock?
    end

    tests('Fog.mock? with Fog.mock!').returns(true) do
      Fog.mock!
      Fog.mock?
    end

    tests('Fog.mocking? without Fog.mock!').returns(false) do
      Fog.mocking?
    end

    tests('Fog.mocking? with Fog.mock!').returns(true) do
      Fog.mock!
      Fog.mocking?
    end
  end

  tests('Fog::Mock.delay') do
    tests('Fog::Mock.delay').returns(1, "defaults to 1") do
      Fog::Mock.delay
    end

    tests('Fog::Mock.delay = 2').returns(2, "changes Fog::Mock.delay to 2") do
      Fog::Mock.delay = 2
      Fog::Mock.delay
    end

    tests('Fog::Mock.delay = 0').returns(0, "changes Fog::Mock.delay to 0") do
      Fog::Mock.delay = 0
      Fog::Mock.delay
    end

    tests('Fog::Mock.delay = -1').raises(ArgumentError) do
      Fog::Mock.delay = -1
    end
  end

  tests('Fog::Mock.not_implemented').raises(Fog::Errors::MockNotImplemented) do
    Fog::Mock.not_implemented
  end

  
end

Version data entries

53 entries across 53 versions & 16 rubygems

Version Path
gapinc-fog-1.12.1.2.1 tests/core/mocking_tests.rb
fog-1.14.0 tests/core/mocking_tests.rb
fog-1.13.0 tests/core/mocking_tests.rb
gapinc-fog-1.12.1.2 tests/core/mocking_tests.rb
gapinc-fog-1.12.1.1 tests/core/mocking_tests.rb
gapinc-fog-1.12.1a tests/core/mocking_tests.rb
gapinc-fog-1.12.1 tests/core/mocking_tests.rb
fog-1.12.1 tests/core/mocking_tests.rb
fog-1.12.0 tests/core/mocking_tests.rb
hpfog-0.0.20 tests/core/mocking_tests.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/tests/core/mocking_tests.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/tests/core/mocking_tests.rb
fog-nirvanix-1.8.2 tests/core/mocking_tests.rb
fog-1.11.1 tests/core/mocking_tests.rb
fog-1.11.0 tests/core/mocking_tests.rb
fog-nirvanix-1.8.1 tests/core/mocking_tests.rb
fog-1.10.1 tests/core/mocking_tests.rb
fog-parser-fix-1.6.1 tests/core/mocking_tests.rb
fog-test-again-1.6.0 tests/core/mocking_tests.rb
fog-test-me-1.10.0 tests/core/mocking_tests.rb