fork of spec-kemal for https://gitdab.com/luna/kemal
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Luna 72a0290729 update shard.yml to point to luna/kemal 3 months ago
spec update kemal version 2 years ago
src 0.4.0 2 years ago
.gitignore 0.4.0 2 years ago
.travis.yml First commit 3 years ago
LICENSE First commit 3 years ago
README.md Update README 2 years ago
shard.lock 0.5.0 10 months ago
shard.yml update shard.yml to point to luna/kemal 3 months ago

README.md

spec-kemal

Kemal helpers to Crystal’s spec for easy testing.

Installation

Add it to your shard.yml.

name: your-kemal-app
version: 0.1.0

dependencies:
  spec-kemal:
    github: kemalcr/spec-kemal
    branch: master
  kemal:
    github: kemalcr/kemal
    branch: master

Usage

Just require it before your files in your spec/spec_helper.cr

require "spec-kemal"
require "../src/your-kemal-app"

Your Kemal application

# src/your-kemal-app.cr

require "kemal"

get "/" do
  "Hello World!"
end

Kemal.run

Now you can easily test your Kemal application in your specs.

KEMAL_ENV=test crystal spec
# spec/your-kemal-app-spec.cr

describe "Your::Kemal::App" do

  # You can use get,post,put,patch,delete to call the corresponding route.
  it "renders /" do
    get "/"
    response.body.should eq "Hello World!"
  end

end

Contributing

  1. Fork it ( https://github.com/kemalcr/spec-kemal/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am ‘Add some feature’)
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors