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.10 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.9 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.8 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.7 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.6 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.5 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.4 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.3 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.2 templates/crystal/example/spec/handler_spec.cr
faastruby-0.5.0 templates/crystal/example/spec/handler_spec.cr