Sha256: 7098fb6d02b1ba396cdead7c522ecb5b83a6aa6a7009a0a2e27ae3609d16e1e3

Contents?: true

Size: 955 Bytes

Versions: 77

Compression:

Stored size: 955 Bytes

Contents

RSpec::Matchers.define :have_route do |destination|
  match do |route_table|
    if !is_ipaddr?(destination) && @use_destination # for deprecated usage
      @gateway_id = destination
    else
      @destination = destination
    end
    route_table.has_route?(@destination, @gateway_id, @instance_id, @vpc_peering_connection_id, @nat_gateway_id)
  end

  chain :target do |target|
    @gateway_id = target[:gateway]
    @instance_id = target[:instance]
    @vpc_peering_connection_id = target[:vpc_peering_connection]
    @nat_gateway_id = target[:nat]
  end

  chain :destination do |dest|
    # rubocop:disable Metrics/LineLength
    puts ''
    warn Color.on_red(Color.white('!!! route_table destination is deprecated. see https://github.com/k1LoW/awspec/pull/65 !!!'))
    # rubocop:enable Metrics/LineLength
    @use_destination = true
    @destination = dest
  end

  private

  def is_ipaddr?(str)
    IPAddr.new(str)
  rescue
    false
  end
end

Version data entries

77 entries across 77 versions & 3 rubygems

Version Path
awspec-1.25.1 lib/awspec/matcher/have_route.rb
awspec-1.25.0 lib/awspec/matcher/have_route.rb
awspec-1.24.4 lib/awspec/matcher/have_route.rb
awspec-1.24.3 lib/awspec/matcher/have_route.rb
awspec-1.24.2 lib/awspec/matcher/have_route.rb
awspec-1.24.1 lib/awspec/matcher/have_route.rb
awspec-1.24.0 lib/awspec/matcher/have_route.rb
awspec-1.23.0 lib/awspec/matcher/have_route.rb
awspec-1.22.1 lib/awspec/matcher/have_route.rb
awspec-1.22.0 lib/awspec/matcher/have_route.rb
awspec-1.21.1 lib/awspec/matcher/have_route.rb
awspec-1.21.0 lib/awspec/matcher/have_route.rb
awspec-1.20.0 lib/awspec/matcher/have_route.rb
awspec-1.19.2 lib/awspec/matcher/have_route.rb
awspec-1.19.1 lib/awspec/matcher/have_route.rb
awspec-1.19.0 lib/awspec/matcher/have_route.rb
cthiesfork-awspec-1.2.4 lib/awspec/matcher/have_route.rb
awspec-api_gateway_extended-1.2.4 lib/awspec/matcher/have_route.rb
awspec-api_gateway_extended-1.2.3 lib/awspec/matcher/have_route.rb
awspec-1.18.6 lib/awspec/matcher/have_route.rb