slate
A barebones fixture library for supporting specs in crystal projects
Installation
- Add the dependency to your
shard.yml
:
development_dependencies:
slate:
gitlab: yumoose/slate
- Run
shards install
Usage
Require Slate and load fixtures in the spec helper for your project
# spec/spec_helper.cr
require "slate"
Spec.before_each do
Slate.load_fixtures
end
Or if your project supports transactions, with Jennifer ORM for example,
# spec/spec_helper.cr
require "slate"
Slate.load_fixtures
Spec.before_each do
Jennifer::Adapter.adapter.begin_transaction
end
Spec.after_each do
Jennifer::Adapter.adapter.rollback_transaction
end
Contributing
- Fork it (https://gitlab.com/yumoose/slate/forks/new)
- 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
- Jordane Lew - creator and maintainer