Sha256: a66cd5539aca583abb7e4e2d494f6d7119d36fcc2c6f359341dfbb18851146c2

Contents?: true

Size: 582 Bytes

Versions: 1

Compression:

Stored size: 582 Bytes

Contents

require 'helper'

class MissingApiKeyTest < Fastly::TestCase
  include CommonTests

  def setup
    # missing API key
    @opts = login_opts(:full)
    begin
      @client = Fastly::Client.new(@opts)
      @fastly = Fastly.new(@opts)
    rescue Exception => e
      pp e
      exit(-1)
    end
  end

  def test_purging
    service_name = "fastly-test-service-#{get_rand}"
    service      = @fastly.create_service(:name => service_name)

    assert_raises Fastly::AuthRequired do
      service.purge_by_key('somekey')
    end
  ensure
    @fastly.delete_service(service)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fastly-1.1.4 test/missing_api_key_test.rb