Sha256: a78c7cfbc4fe5a5a69d88c6b28ae8490a020ec4930d0e7cd657ecc9c89f311ba

Contents?: true

Size: 552 Bytes

Versions: 30

Compression:

Stored size: 552 Bytes

Contents

require "./spec_helper"

private def event_hash
  {
    "body" => nil,
    "context" => nil,
    "headers" => {"Content-Type" => "application/json"},
    "query_params" => {} of String => String
  }
end

private def event
  Event.from_json(event_hash.to_json)
end

describe "handler(event)" do
  it "should return String" do
    body = handler(event).body
    body.should be_a String
  end

  it "should say Hello, World!" do
    event = Event.from_json(event_hash.to_json)
    body = handler(event).body
    body.should eq("Hello, World!\n")
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
faastruby-0.5.30 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.29 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.28 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.27 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.26 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.25 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.24 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.23 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.22 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.21 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.20 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.19 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.18 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.17 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.16 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.15 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.14 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.13 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.12 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.11 templates/crystal/example/spec/handler_spec.cr