Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Features

  • Run for length of time
  • Run for number of iterations
  • Run for both and stop at whichever comes first
  • Reuse RSpec structure
  • Running semantics:
    • I want to run for N iterations limited to X minutes in CI
    • I want to run for a few seconds with rake
    • I want to run for a shorter period of time with guard

Terminology

Property

Invariant

Data

DSL

require 'something'
require 'something/rspec'

describe String do
  describe "#reverse" do    
    let(:string) { "foo bar" }

    it "reverses" do
      expect(string.reverse).to eq("rab oof")
    end

    generative do
      data(:string) { String.random }

      it "maintains length" do
        expect(string.reverse.length).to eq(string.length)
      end

      it "is not destructive" do
        expect(string.reverse.reverse).to eq(string)
      end
    end
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.