• Stars
    star
    2
  • Language
    Ruby
  • License
    MIT License
  • Created over 5 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Generate data from contracts

Ruby Gem Version

Contracts::Gen

An extension for Gen::Test, defining generators for Contracts.

Synopsis

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:

gem 'contracts-gen'

to your Gemfile, and then execute:

> bundle

See Also

More Repositories

1

invokable

Objects are functions! Treat any Object or Class as a Proc (like Enumerable but for Procs).
Ruby
43
star
2

mini-levenshtein

Simple, fast Levenshtein distance and similarity ratio for Ruby
C
27
star
3

activerecord-setops

Union, Intersect, and Difference set operations for ActiveRecord (also, SQL's UnionAll).
Ruby
21
star
4

magbot

A CLI application for fetching media from jw.org feeds
Perl
9
star
5

zera-5

A light-weight Clojure interpreter
JavaScript
8
star
6

activerecord-pull

A simple query interface for pulling deeply nested data from records.
Ruby
4
star
7

dragnet

A work-in-progress system for programmable surveys, and forms.
Ruby
2
star
8

ALJAFP

A Little Java, A Few Patterns
Java
1
star
9

piglatin

Pig Latin translator
Perl
1
star
10

cantor

Relational Algebra and Reporting
Ruby
1
star
11

atomjs

Clojure Atoms for Javascript. Shared, synchronous, independent state. A fork of https://github.com/cjohansen/js-atom.
JavaScript
1
star
12

sinatra-rest-service-auth

Ruby
1
star
13

sleepr

Stop hacking and get some sleep
Perl
1
star
14

connect4

JavaScript
1
star
15

tether

Ruby
1
star
16

tetris.js

An (incomplete) tetris clone
JavaScript
1
star
17

wonderscript-alpha

A lisp for the web
TypeScript
1
star
18

periscope

A Perl Module for viewing sites through a periscope
Perl
1
star
19

pandora-periscope

A Periscope for Pandora
Perl
1
star
20

java-posix

POSIX for Java a clone (for posterity, I have no intention of maintaining this) imported from tarball found here: http://www.bmsi.com/java/posix/index.html
Java
1
star
21

Pudu

A light-weight Moose-like object system that makes it easy to create encapsulated, immutable objects
Perl
1
star
22

Makakilo-Elementary

Ruby
1
star
23

sleepr-preferences

Preferences dialog for sleepr
Python
1
star
24

yugo

An experimental tool for converting legacy ColdFusion applications into Ruby / Rack applications.
Ruby
1
star
25

talks

1
star
26

asdf-vm.el

asdf-vm integration for Emacs
Emacs Lisp
1
star
27

kigo

Ruby is already pretty lispy let's take it the rest of the way.
Ruby
1
star
28

rubygems

A fork to add offline installation features, all changes are in offline branch
Ruby
1
star