Skip to content

Commit

Permalink
fix: cleanup entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
dwilkie committed Oct 11, 2024
1 parent e9e3f4a commit 31242b9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 31 deletions.
16 changes: 2 additions & 14 deletions skyetel/app.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
require "logger"
require_relative "config/application"

module App
class Handler
attr_reader :event, :context

def self.process(event:, context:)
logger = Logger.new($stdout)
logger.info("## Processing Event")
logger.info(event)

new(event:, context:).process
end

def initialize(event:, context:)
@event = event
@context = context
def self.process(**)
new.process
end

def process
Expand Down
7 changes: 1 addition & 6 deletions skyetel/spec/app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,10 @@ module App
:post, "https://api.somleng.org/carrier/v1/phone_numbers",
response_body: file_fixture("somleng/responses/create_phone_number.json").read
)
handler = build_handler

handler.process
App::Handler.process(event: {}, context: double("LambdaContext", as_json: {}))

expect(a_request(:post, "https://api.somleng.org/carrier/v1/phone_numbers")).to have_been_made.times(2)
end

def build_handler(**options)
Handler.new(event: {}, context: double("LambdaContext", as_json: {}), **options)
end
end
end
11 changes: 0 additions & 11 deletions skyetel/spec/support/lambda_helpers.rb

This file was deleted.

0 comments on commit 31242b9

Please sign in to comment.