Degenerate
Degenerate is a random data generator for use with Generative.
Installation
Add this line to your application's Gemfile:
gem 'degenerate'
And then execute:
$ bundle install
Next require it in your spec/spec_helper.rb
file:
require 'degenerate'
Degenerate automatically registers several primative generators with generative.
Usage
In your spec:
describe "#reverse" do
generative do
data(:string) { generate(:string) }
it "should preserve length" do
expect(string.reverse.length).to eq(string.length)
end
end
end
Contributing
- Fork it ( https://github.com/[my-github-username]/degenerate/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