Sha256: ce93e2f45ac47bb5f1b793595bdc4e24348bce7d0475ba84cb138b8d1192a44d

Contents?: true

Size: 509 Bytes

Versions: 43

Compression:

Stored size: 509 Bytes

Contents

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

43 entries across 43 versions & 3 rubygems

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