Sha256: abcd913a5a822c72ad8f7c18a7a42a2a781e6323bb7f9e6194e544623dced77d

Contents?: true

Size: 557 Bytes

Versions: 16

Compression:

Stored size: 557 Bytes

Contents

require "./spec_helper"

describe "handler(event)" do
  event_hash = {
    "body" => nil,
    "context" => nil,
    "headers" => {"Content-Type" => "application/json"},
    "query_params" => {} of String => String
  }
  event = Event.from_json(event_hash.to_json)

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
faastruby-0.4.18 templates/crystal/example/spec/handler_spec.cr
faastruby-0.4.17 templates/crystal/example/spec/handler_spec.cr
faastruby-0.4.16 templates/crystal/example/spec/handler_spec.cr
faastruby-0.4.15 templates/crystal/example/spec/handler_spec.cr
faastruby-0.4.14 templates/crystal/example/spec/handler_spec.cr
faastruby-0.4.12 templates/crystal/example/spec/handler_spec.cr
faastruby-0.4.11 templates/crystal/example/spec/handler_spec.cr
faastruby-0.4.10 templates/crystal/example/spec/handler_spec.cr
faastruby-0.4.9 templates/crystal/example/spec/handler_spec.cr
faastruby-0.4.8 templates/crystal/example/spec/handler_spec.cr
faastruby-0.4.7 templates/crystal/example/spec/handler_spec.cr
faastruby-0.4.6 templates/crystal/example/spec/handler_spec.cr
faastruby-0.4.5 templates/crystal/example/spec/handler_spec.cr
faastruby-0.4.4 templates/crystal/example/spec/handler_spec.cr
faastruby-0.4.3 templates/crystal/example/spec/handler_spec.cr
faastruby-0.4.2 templates/crystal/example/spec/handler_spec.cr