Sha256: 442f94443aee404880add791fbd66e9a56da307794ad0b38a264a9851371b637

Contents?: true

Size: 619 Bytes

Versions: 14

Compression:

Stored size: 619 Bytes

Contents

# frozen_string_literal: true

RSpec::Matchers.define :be_allowed_action do |action_name|
  match do |type|
    results = type.select_policy_evaluation_results(type.resource_via_client[:arn],
                                                    action_name,
                                                    @resource_arn,
                                                    @context_entries)
    results.find do |result|
      result.eval_decision == 'allowed'
    end
  end

  chain :resource_arn do |arn|
    @resource_arn = arn
  end

  chain :context_entries do |context|
    @context_entries = context
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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