Sha256: f1e1b57ea4c0e5b0a14a94786b593a419828ecd8281505cabd9c5fe3dfdc4083

Contents?: true

Size: 739 Bytes

Versions: 4

Compression:

Stored size: 739 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 "still prints pending spec names"

    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

4 entries across 4 versions & 1 rubygems

Version Path
generative-0.2.0 spec/generative_spec.rb
generative-0.2.0.pre3 spec/generative_spec.rb
generative-0.2.0.pre2 spec/generative_spec.rb
generative-0.2.0.pre1 spec/generative_spec.rb