Sha256: 4399fe69b64501a1703120fcf6b731b9343d42cc3121f44bb18ca094fc54f044

Contents?: true

Size: 869 Bytes

Versions: 5

Compression:

Stored size: 869 Bytes

Contents

RSpec::Matchers.define :have_record_set do |name|
  match do |hosted_zone|
    hosted_zone.has_record_set?(name, @type, @value, @options)
  end

  %w(soa a txt ns cname mx ptr srv spf aaaa caa).each do |type|
    chain type do |value|
      @type = type
      @value = value
      @options = {} if @options.nil?
    end
  end

  chain :alias do |dns_name, hosted_zone_id|
    @type = 'a'
    @options = {} if @options.nil?
    @options[:alias_dns_name] = dns_name
    @options[:alias_hosted_zone_id] = hosted_zone_id
  end

  chain :aaaa_alias do |dns_name, hosted_zone_id|
    @type = 'aaaa'
    @options = {} if @options.nil?
    @options[:alias_dns_name] = dns_name
    @options[:alias_hosted_zone_id] = hosted_zone_id
  end

  chain :ttl do |ttl|
    @options = {} if @options.nil?
    @options[:ttl] = ttl
  end

  chain :type do |type|
    @type = type
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
awspec-1.18.0 lib/awspec/matcher/have_record_set.rb
awspec-1.17.4 lib/awspec/matcher/have_record_set.rb
awspec-1.17.3 lib/awspec/matcher/have_record_set.rb
awspec-1.17.2 lib/awspec/matcher/have_record_set.rb
awspec-1.17.1 lib/awspec/matcher/have_record_set.rb