Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/rantly/shrinks.rb

Overview

String : shrink to “”

Instance Method Summary collapse

Instance Method Details

#retry?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/rantly/shrinks.rb', line 37

def retry?
  false
end

#shrinkObject



28
29
30
31
32
33
34
35
# File 'lib/rantly/shrinks.rb', line 28

def shrink
  shrunk = dup
  unless empty?
    idx = Random.rand(size)
    shrunk[idx] = ''
  end
  shrunk
end

#shrinkable?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/rantly/shrinks.rb', line 41

def shrinkable?
  self != ''
end