Sha256: 21f601ec20ce4c14ad6a6fb5f90775152492591f8ef2c7e800405c8da8807ea9

Contents?: true

Size: 540 Bytes

Versions: 12

Compression:

Stored size: 540 Bytes

Contents

# frozen_string_literal: true

RSpec::Matchers.define :have_env_var_value do |env_var, value|
  match do |lambda_function|
    if lambda_function.environment.variables.key?(env_var)
      lambda_function.environment.variables[env_var] == value
    else
      false
    end
  end

  description do
    "have the value #{value}"
  end

  failure_message do |lambda_function|
    current_value = lambda_function.environment.variables[env_var]
    "Environment variable #{env_var} don't have the value #{value}, but #{current_value}"
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
awspec-1.30.0 lib/awspec/matcher/have_env_var_value.rb
awspec-1.29.3 lib/awspec/matcher/have_env_var_value.rb
awspec-1.29.2 lib/awspec/matcher/have_env_var_value.rb
awspec-1.29.1 lib/awspec/matcher/have_env_var_value.rb
awspec-1.29.0 lib/awspec/matcher/have_env_var_value.rb
awspec-1.28.2 lib/awspec/matcher/have_env_var_value.rb
awspec-1.28.1 lib/awspec/matcher/have_env_var_value.rb
awspec-1.28.0 lib/awspec/matcher/have_env_var_value.rb
awspec-1.27.1 lib/awspec/matcher/have_env_var_value.rb
awspec-1.27.0 lib/awspec/matcher/have_env_var_value.rb
awspec-1.26.0 lib/awspec/matcher/have_env_var_value.rb
awspec-1.25.2 lib/awspec/matcher/have_env_var_value.rb