Sha256: bc9696141a1ed6c6c2d90221d375bb71188d642813c620d14599b48bab1443a3

Contents?: true

Size: 904 Bytes

Versions: 13

Compression:

Stored size: 904 Bytes

Contents

# frozen_string_literal: true

module Awspec::Generator
  module Spec
    class Lambda
      include Awspec::Helper::Finder
      def generate_all
        lambda_functions = select_all_lambda_functions
        raise 'Not Found lambda' if lambda_functions.empty?

        ERB.new(lambda_spec_template, nil, '-').result(binding).chomp
      end

      def lambda_spec_template
        <<-'EOF'
<% lambda_functions.each do |function| %>
describe lambda('<%= function.function_name %>') do
  it { should exist }
  its(:description) { should eq '<%= function.description %>' }
  its(:runtime) { should eq '<%= function.runtime %>' }
  its(:handler) { should eq '<%= function.handler %>' }
  its(:code_size) { should eq <%= function.code_size %> }
  its(:timeout) { should eq <%= function.timeout %> }
  its(:memory_size) { should eq <%= function.memory_size %> }
end
<% end %>
EOF
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
awspec-1.31.0 lib/awspec/generator/spec/lambda.rb
awspec-1.30.0 lib/awspec/generator/spec/lambda.rb
awspec-1.29.3 lib/awspec/generator/spec/lambda.rb
awspec-1.29.2 lib/awspec/generator/spec/lambda.rb
awspec-1.29.1 lib/awspec/generator/spec/lambda.rb
awspec-1.29.0 lib/awspec/generator/spec/lambda.rb
awspec-1.28.2 lib/awspec/generator/spec/lambda.rb
awspec-1.28.1 lib/awspec/generator/spec/lambda.rb
awspec-1.28.0 lib/awspec/generator/spec/lambda.rb
awspec-1.27.1 lib/awspec/generator/spec/lambda.rb
awspec-1.27.0 lib/awspec/generator/spec/lambda.rb
awspec-1.26.0 lib/awspec/generator/spec/lambda.rb
awspec-1.25.2 lib/awspec/generator/spec/lambda.rb