Permalink
Browse files

checkpoint: remove require spec_helper

  • Loading branch information...
tongueroo committed Aug 3, 2018
1 parent f40cd27 commit fdf8a4bc27bec16f841ca490471047c951c261af
Showing with 188 additions and 129 deletions.
  1. +2 −1 .rspec
  2. +58 −0 event.json
  3. +1 −0 lib/jets.rb
  4. +28 −0 lib/jets/poly_fun.rb
  5. +13 −0 lib/jets/poly_fun/lambda_executor.rb
  6. +5 −0 lib/jets/poly_fun/node_executor.rb
  7. +11 −0 lib/jets/poly_fun/python_executor.rb
  8. +58 −0 spec/fixtures/dumps/api_gateway/books/index.json
  9. +0 −2 spec/lib/jets/application_spec.rb
  10. +0 −2 spec/lib/jets/build/code_builder_spec.rb
  11. +0 −2 spec/lib/jets/build/deducer_spec.rb
  12. +0 −2 spec/lib/jets/build/gem_fetcher_spec.rb
  13. +0 −2 spec/lib/jets/build/handler_generator_spec.rb
  14. +0 −2 spec/lib/jets/cfn/ship_spec.rb
  15. +0 −2 spec/lib/jets/cfn/template_builders/api_gateway_builder_spec.rb
  16. +0 −2 spec/lib/jets/cfn/template_builders/api_gateway_deployment_spec.rb
  17. +0 −2 spec/lib/jets/cfn/template_builders/base_child_builder_spec.rb
  18. +0 −2 spec/lib/jets/cfn/template_builders/controller_builder_spec.rb
  19. +0 −2 spec/lib/jets/cfn/template_builders/function_builder_spec.rb
  20. +0 −2 spec/lib/jets/cfn/template_builders/function_properties_builder_spec.rb
  21. +0 −2 spec/lib/jets/cfn/template_builders/interface_spec.rb
  22. +0 −2 spec/lib/jets/cfn/template_builders/job_builder_spec.rb
  23. +0 −2 spec/lib/jets/cfn/template_builders/parent_builder_spec.rb
  24. +0 −2 spec/lib/jets/cfn/template_builders/rule_builer_spec.rb
  25. +0 −2 spec/lib/jets/cfn/template_mappers/api_gateway_deployment_mapper_spec.rb
  26. +0 −2 spec/lib/jets/cfn/template_mappers/api_gateway_mapper_spec.rb
  27. +0 −2 spec/lib/jets/cfn/template_mappers/child_mapper_spec.rb
  28. +0 −2 spec/lib/jets/cfn/template_mappers/config_rule_mapper_spec.rb
  29. +0 −2 spec/lib/jets/cfn/template_mappers/events_rule_mapper_spec.rb
  30. +0 −2 spec/lib/jets/cfn/template_mappers/gateway_deployment_mapper_spec.rb
  31. +0 −2 spec/lib/jets/cfn/template_mappers/gateway_method_mapper_spec.rb
  32. +0 −2 spec/lib/jets/cfn/template_mappers/gateway_resource_mapper_spec.rb
  33. +0 −2 spec/lib/jets/cfn/template_mappers/lambda_function_mapper_spec.rb
  34. +0 −2 spec/lib/jets/cli_spec.rb
  35. +0 −2 spec/lib/jets/commands/base_spec.rb
  36. +0 −2 spec/lib/jets/commands/build_spec.rb
  37. +0 −2 spec/lib/jets/commands/call/anonymous_guesser_spec.rb
  38. +0 −2 spec/lib/jets/commands/call/autoload_guesser_spec.rb
  39. +0 −2 spec/lib/jets/commands/call_spec.rb
  40. +0 −2 spec/lib/jets/commands/deploy_spec.rb
  41. +0 −2 spec/lib/jets/commands/rake_command_spec.rb
  42. +0 −2 spec/lib/jets/controller/base_spec.rb
  43. +0 −2 spec/lib/jets/controller/callbacks_spec.rb
  44. +0 −2 spec/lib/jets/controller/params_spec.rb
  45. +0 −2 spec/lib/jets/controller/redirect_spec.rb
  46. +0 −2 spec/lib/jets/controller/redirection_spec.rb
  47. +0 −2 spec/lib/jets/controller/rendering_spec.rb
  48. +0 −2 spec/lib/jets/controller/request_spec.rb
  49. +0 −3 spec/lib/jets/generate_spec.rb
  50. +0 −2 spec/lib/jets/job/base_spec.rb
  51. +0 −2 spec/lib/jets/job/task_spec.rb
  52. +0 −2 spec/lib/jets/klass_spec.rb
  53. +0 −2 spec/lib/jets/lambda/dsl_spec.rb
  54. +0 −2 spec/lib/jets/lambda/function_constructor_spec.rb
  55. +0 −2 spec/lib/jets/lambda/function_spec.rb
  56. +0 −2 spec/lib/jets/lambda/task_spec.rb
  57. +0 −2 spec/lib/jets/naming_spec.rb
  58. +0 −2 spec/lib/jets/pascalize_spec.rb
  59. +12 −0 spec/lib/jets/poly_fun_spec.rb
  60. +0 −2 spec/lib/jets/process/deducer_spec.rb
  61. +0 −2 spec/lib/jets/process/main_processor_spec.rb
  62. +0 −2 spec/lib/jets/processors_spec.rb
  63. +0 −1 spec/lib/jets/rails_overrides/rails_overrides_spec.rb
  64. +0 −2 spec/lib/jets/route_spec.rb
  65. +0 −2 spec/lib/jets/router_spec.rb
  66. +0 −2 spec/lib/jets/rule/base_spec.rb
  67. +0 −2 spec/lib/jets/rule/dsl_spec.rb
  68. +0 −2 spec/lib/jets/rule/task_spec.rb
  69. +0 −2 spec/lib/jets/server/api_gateway_spec.rb
  70. +0 −2 spec/lib/jets/server/lambda_aws_proxy_spec.rb
  71. +0 −2 spec/lib/jets/server/route_matcher_spec.rb
  72. +0 −2 spec/lib/jets/server_spec.rb
  73. +0 −2 spec/lib/shell_spec.rb
3 .rspec
@@ -1,3 +1,4 @@
--color
--format documentation
--exclude-pattern spec/fixtures/apps/**/*
--format documentation
--require spec_helper
@@ -0,0 +1,58 @@
{
"resource": "/posts",
"path": "/posts",
"httpMethod": "POST",
"headers": {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate",
"cache-control": "no-cache",
"CloudFront-Forwarded-Proto": "https",
"CloudFront-Is-Desktop-Viewer": "true",
"CloudFront-Is-Mobile-Viewer": "false",
"CloudFront-Is-SmartTV-Viewer": "false",
"CloudFront-Is-Tablet-Viewer": "false",
"CloudFront-Viewer-Country": "US",
"Content-Type": "text/plain",
"Host": "uhghn8z6t1.execute-api.us-east-1.amazonaws.com",
"Postman-Token": "7166b11b-59de-4e7b-ad35-24e556b7a083",
"User-Agent": "PostmanRuntime/6.4.1",
"Via": "1.1 55676da1e5c0a9c4e60a94a95b01dc04.cloudfront.net (CloudFront)",
"X-Amz-Cf-Id": "iERhUw6ghRnv1uRYfxJaUsDGWVbERFSZ4K00CIgZtJ0T6yeFdItMeQ==",
"X-Amzn-Trace-Id": "Root=1-59f50229-587ec5271678236e50ad91b1",
"X-Forwarded-For": "69.42.1.180, 54.239.203.100",
"X-Forwarded-Port": "443",
"X-Forwarded-Proto": "https"
},
"queryStringParameters": {
"a": "1",
"b": "2"
},
"pathParameters": null,
"stageVariables": null,
"requestContext": {
"path": "/stag/posts",
"accountId": "160619113767",
"resourceId": "c0yhg8",
"stage": "stag",
"requestId": "e5c39604-bc2d-11e7-abbe-1baaa0f8e02e",
"identity": {
"cognitoIdentityPoolId": null,
"accountId": null,
"cognitoIdentityId": null,
"caller": null,
"apiKey": "",
"sourceIp": "69.42.1.180",
"accessKey": null,
"cognitoAuthenticationType": null,
"cognitoAuthenticationProvider": null,
"userArn": null,
"userAgent": "PostmanRuntime/6.4.1",
"user": null
},
"resourcePath": "/posts",
"httpMethod": "POST",
"apiId": "uhghn8z6t1"
},
"body": "{\n \"key3\": \"value3\",\n \"key2\": \"value2\",\n \"key1\": \"value1\"\n}",
"isBase64Encoded": false
}
@@ -21,6 +21,7 @@ module Jets
autoload :Job, 'jets/job'
autoload :Lambda, 'jets/lambda'
autoload :Naming, 'jets/naming'
autoload :PolyFun, 'jets/poly_fun'
autoload :Processors, 'jets/processors'
autoload :Route, "jets/route"
autoload :Router, "jets/router"
@@ -0,0 +1,28 @@
module Jets
class PolyFun
autoload :LambdaExecutor, 'jets/poly_fun/lambda_executor' # main class delegates to other classes
autoload :PythonExecutor, 'jets/poly_fun/python_executor' # main class delegates to other classes
autoload :NodeExecutor, 'jets/poly_fun/node_executor' # main class delegates to other classes

extend Memoist

def initialize(app_class, app_meth)
@app_class = app_class # already a Constant, IE: PostController
@app_meth = app_meth
end

def process(event, context={})
if task.lang == :ruby
@app_class.process(event, context, @app_meth)
else
executor = LambdaExecutor.new(task)
executor.run(event, context)
end
end

def task
@app_class.tasks.find { |t| t.meth == @app_meth }
end
memoize :task
end
end
@@ -0,0 +1,13 @@
class Jets::PolyFun
class LambdaExecutor
def initialize(task)
@task = task
end

def run(event, context)
executor_class = "#{task.lang}_executor".classify.constantize
executor = executor_class.new(task)
executor.run(event, context)
end
end
end
@@ -0,0 +1,5 @@
class Jets::PolyFun
class NodeExecutor

end
end
@@ -0,0 +1,11 @@
class Jets::PolyFun
class PythonExecutor
def initialize(task)
@task = task
end

def run(event, context)
puts "python executor ran"
end
end
end
@@ -0,0 +1,58 @@
{
"resource": "/books",
"path": "/books",
"httpMethod": "GET",
"headers": {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate",
"cache-control": "no-cache",
"CloudFront-Forwarded-Proto": "https",
"CloudFront-Is-Desktop-Viewer": "true",
"CloudFront-Is-Mobile-Viewer": "false",
"CloudFront-Is-SmartTV-Viewer": "false",
"CloudFront-Is-Tablet-Viewer": "false",
"CloudFront-Viewer-Country": "US",
"Content-Type": "text/plain",
"Host": "uhghn8z6t1.execute-api.us-east-1.amazonaws.com",
"Postman-Token": "7166b11b-59de-4e7b-ad35-24e556b7a083",
"User-Agent": "PostmanRuntime/6.4.1",
"Via": "1.1 55676da1e5c0a9c4e60a94a95b01dc04.cloudfront.net (CloudFront)",
"X-Amz-Cf-Id": "iERhUw6ghRnv1uRYfxJaUsDGWVbERFSZ4K00CIgZtJ0T6yeFdItMeQ==",
"X-Amzn-Trace-Id": "Root=1-59f50229-587ec5271678236e50ad91b1",
"X-Forwarded-For": "69.42.1.180, 54.239.203.100",
"X-Forwarded-Port": "443",
"X-Forwarded-Proto": "https"
},
"queryStringParameters": {
"a": "1",
"b": "2"
},
"pathParameters": null,
"stageVariables": null,
"requestContext": {
"path": "/stag/books",
"accountId": "160619113767",
"resourceId": "c0yhg8",
"stage": "stag",
"requestId": "e5c39604-bc2d-11e7-abbe-1baaa0f8e02e",
"identity": {
"cognitoIdentityPoolId": null,
"accountId": null,
"cognitoIdentityId": null,
"caller": null,
"apiKey": "",
"sourceIp": "69.42.1.180",
"accessKey": null,
"cognitoAuthenticationType": null,
"cognitoAuthenticationProvider": null,
"userArn": null,
"userAgent": "PostmanRuntime/6.4.1",
"user": null
},
"resourcePath": "/books",
"httpMethod": "GET",
"apiId": "uhghn8z6t1"
},
"body": "{\n \"key3\": \"value3\",\n \"key2\": \"value2\",\n \"key1\": \"value1\"\n}",
"isBase64Encoded": false
}
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Application do
context "Jets::Application.new" do
let(:app) do
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Builders::CodeBuilder do
context "general" do
let(:builder) do
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Builders::Deducer do
context "controller without namespace" do
let(:deducer) do
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Builders::GemFetcher do
context "already downloaded" do
let(:fetcher) do
@@ -1,5 +1,3 @@
require "spec_helper"

describe "HandlerGenerator" do
context "controller" do
let(:generator) do
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::Ship do
let(:ship) do
Jets::Cfn::Ship.new(noop: true)
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateBuilders::ApiGatewayBuilder do
let(:builder) do
Jets::Cfn::TemplateBuilders::ApiGatewayBuilder.new({})
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateBuilders::ApiGatewayDeploymentBuilder do
let(:builder) do
Jets::Cfn::TemplateBuilders::ApiGatewayDeploymentBuilder.new({})
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateBuilders::BaseChildBuilder do
let(:builder) do
Jets::Cfn::TemplateBuilders::BaseChildBuilder.new(app_class)
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateBuilders::ControllerBuilder do
let(:builder) do
Jets::Cfn::TemplateBuilders::ControllerBuilder.new(app_class)
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateBuilders::FunctionBuilder do
let(:builder) do
Jets::Cfn::TemplateBuilders::FunctionBuilder.new(klass)
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateBuilders::FunctionPropertiesBuilder do
let(:builder) do
Jets::Cfn::TemplateBuilders::FunctionPropertiesBuilder.new(task)
@@ -1,5 +1,3 @@
require "spec_helper"

class InterfaceTest
include Jets::Cfn::TemplateBuilders::Interface
end
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateBuilders::JobBuilder do
let(:builder) do
Jets::Cfn::TemplateBuilders::JobBuilder.new(HardJob)
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateBuilders::ParentBuilder do
context "first run" do
let(:builder) do
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateBuilders::RuleBuilder do
let(:builder) do
Jets::Cfn::TemplateBuilders::RuleBuilder.new(GameRule)
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateMappers::ApiGatewayDeploymentMapper do
let(:map) do
Jets::Cfn::TemplateMappers::ApiGatewayDeploymentMapper.new("#{Jets.build_root}/templates/#{Jets.config.project_namespace}-api-gateway-deployment.yml", "s3-bucket")
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateMappers::ApiGatewayMapper do
let(:map) do
Jets::Cfn::TemplateMappers::ApiGatewayMapper.new("#{Jets.build_root}/templates/#{Jets.config.project_namespace}-api-gateway.yml", "s3-bucket")
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateMappers::ChildMapper do
let(:map) do
Jets::Cfn::TemplateMappers::ChildMapper.new("#{Jets.build_root}/templates/#{Jets.config.project_namespace}-posts-controller.yml", "s3-bucket")
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateMappers::ConfigRuleMapper do
let(:map) do
Jets::Cfn::TemplateMappers::ConfigRuleMapper.new(task)
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateMappers::EventsRuleMapper do
let(:map) do
Jets::Cfn::TemplateMappers::EventsRuleMapper.new(task)
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateMappers::ApiGatewayDeploymentMapper do
let(:map) do
Jets::Cfn::TemplateMappers::ApiGatewayDeploymentMapper.new("path", "s3-bucket")
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateMappers::GatewayMethodMapper do
let(:map) do
Jets::Cfn::TemplateMappers::GatewayMethodMapper.new(route)
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateMappers::GatewayResourceMapper do
let(:map) do
Jets::Cfn::TemplateMappers::GatewayResourceMapper.new(path)
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Cfn::TemplateMappers::LambdaFunctionMapper do
context "controller" do
let(:map) do
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::CLI do
let(:command) { Jets::CLI.new(given_args) }

@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Commands::Base do
let(:null) { double(:null).as_null_object }
let(:command) do
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Commands::Build do
before(:each) do
FileUtils.rm_f("spec/fixtures/project/handlers/controllers/posts.js")
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Commands::Call::AnonymousGuesser do
let(:guesser) { Jets::Commands::Call::AnonymousGuesser.new(function_name) }

@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Commands::Call::AutoloadGuesser do
let(:guesser) { Jets::Commands::Call::AutoloadGuesser.new(function_name) }

@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Commands::Call do
let(:call) do
call = Jets::Commands::Call.new(provided_function_name, event, mute: true)
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Commands::Deploy do
let(:build) do
Jets::Commands::Deploy.new(noop: true)
@@ -1,5 +1,3 @@
require "spec_helper"

describe Jets::Commands::RakeCommand do
context Jets::Commands::RakeCommand do

Oops, something went wrong.

0 comments on commit fdf8a4b

Please sign in to comment.