wax-spec
Version, currently main branch1 version
- main branchlatestApr 7, 2026
github.com/jgaskins/wax-spec
Spec helpers for the `wax` shard
2 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
wax-spec:
github: jgaskins/wax-spec
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 1.12.1- License
- MIT
- Author
- Jamie Gaskins
Dependencies
Runtime Dependencies
README
Wax::Spec
Adds spec helpers for apps using the wax shard. This was pulled out to a separate shard so that apps wouldn't have spec-only dependencies in their production apps.
Installation
-
Add the dependency to your
shard.yml:development_dependencies: wax-spec: github: jgaskins/wax-spec -
Run
shards install
Usage
In your application's spec helpers, load the appropriate helpers provided by wax-spec. For example, in your applications' spec/routes/route_helper.cr, you would do this:
require "../spec_helper" # your app-wide baseline spec helper file
require "wax-spec/route_helper"
Then in your specs you can do this:
describe RouteUnderTest do
app = app(RouteUnderTest.new)
context "GET /" do
it "returns 200 OK" do
response = app.get "/"
response.should have_status :ok
response.should have_html "Hello"
end
end
context "POST /" do
it "returns 201 CREATED with the correct params" do
response = app.post "/", form: {
# other params ...
_authenticity_token: app.authenticity_token,
}
response.should have_status :created
end
it "returns 400 BAD REQUEST without the authenticity token" do
response = app.post "/", form: {
# non-authenticity-token params
}
response.should have_status :bad_request
end
end
end
Contributing
- Fork it (https://github.com/jgaskins/wax-spec/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Jamie Gaskins - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Apr 7, 2026
- Crystal
>= 1.12.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/jgaskins/wax-spec
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 1