Sha256: 5d5660e1c407313ae317ed159367da12d1134cb301a4319694e7a9e94deacd59

Contents?: true

Size: 900 Bytes

Versions: 178

Compression:

Stored size: 900 Bytes

Contents

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
        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
        template
      end
    end
  end
end

Version data entries

178 entries across 178 versions & 4 rubygems

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