expect

Version, currently master branch1 version
  • master branchlatestJul 5, 2022

github.com/dukex/expect.cr

Enable expect syntax in crystal specs

6 stars
1 dependent
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  expect:
    github: dukex/expect.cr
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
>= 0.35.0, < 2.0.0
License
MIT
Author
Duke <emersonalmeidax@gmail.com>

Dependencies

This version declares no dependencies.

README

# expect.cr

expect.cr enabled the expect syntax to your specs


## Installation

Add this to your application's `shard.yml`:

```yaml
dependencies:
  expect:
    github: dukex/expect.cr
```


## Usage

Require expect in your spec file

```crystal
require "expect"
```

Use expect syntax like in rspec

```crystal

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
```

## Development

```
$ crystal deps
$ crystal spec
```

## Contributing

1. Fork it ( https://github.com/[your-github-name]/expect.cr/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

- [[dukex]](https://github.com/dukex) Duke - creator, maintainer