expect.cr enabled the expect syntax to your specs
Add this to your application's shard.yml
:
dependencies:
expect:
github: dukex/expect.cr
Require expect in your spec file
require "expect"
Use expect syntax like in rspec
describe "My Specs" do
it "expects 1 is equal 1" do
expect(1).to eq(7)
end
it "expects nil is nil" do
expect(nil).to be_nil
end
it "expects 5 is not 4" do
expect(5).not_to eq(4)
end
end
$ crystal deps
$ crystal spec
- Fork it ( https://github.com/[your-github-name]/expect.cr/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
- [dukex] Duke - creator, maintainer