Sha256: c42375968eadaf814f09854b9dd2bc6a4a22c9725a82b44179a5d4fe83fc3fb6

Contents?: true

Size: 724 Bytes

Versions: 1

Compression:

Stored size: 724 Bytes

Contents

require 'generative'

describe String do
  let(:string) { "abc" }

  describe "#length" do
    it "counts characters" do
      expect(string.length).to eq(3)
    end

    xit "does other stuff"

    generative do
      data(:string) { "a" * rand(255) }

      it "is never negative" do
        expect(string.length).to be >= 0
      end
    end
  end

  describe "#reverse" do
    it "reverses" do
      expect(string.reverse).to eq("cba")
    end

    generative do
      data(:string) { rand(12345).to_s }

      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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
generative-0.1.0 spec/generative_spec.rb