Create a gist now

Instantly share code, notes, and snippets.

DSL

require 'something'
require 'something/rspec'

describe String do
  describe "#wrap" do
    it "wraps" do
      expect("test foo".wrap(4)).to eq("test\nfoo")
    end

    generative do
      data(:string, String)
      data(:wrap_at) { rand(255) }

      property do
        expect(string.wrap(wrap_at)).to_not be_nil
        expect(string.wrap(wrap_at).length).to eq(string.length)
      end
    end
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment