Sha256: e6ff9746bf47c23e893e89e30229d644c1b95193766b5ed6b69dd027df7f42af

Contents?: true

Size: 754 Bytes

Versions: 2

Compression:

Stored size: 754 Bytes

Contents

Contracts::Gen
==============

An extension for [Gen::Test][1], defining generators for [Contracts][2].

Synopsis
========

```ruby
require 'gen/test'
require 'contracts'
require 'contracts/gen'

Sum = lambda { |xs| xs.reduce(:+) }

C = Contracts

class SumTest < Minitest::Test
  include Gen::Test

  def test_sum_for_all_arrays_of_integers
    for_all C::ArrayOf[Integer] do |xs|
      y = Sum[xs]
      assert_equal(y, xs.reduce(:+))
    end
  end
end
```

Install
=======

    > gem install contracts-gen

or, add:

```ruby
gem 'contracts-gen'
```

to your Gemfile, and then execute:

    > bundle


See Also
========

- [Gen::Test][1]
- [Contracts][2]

[1]: https://github.com/delonnewman/gen-test
[2]: https://github.com/egonSchiele/contracts.ruby

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
contracts-gen-0.1.1 README.md
contracts-gen-0.1.0 README.md