Module: RBS::Test::SetupHelper

Defined in:
lib/rbs/test/setup_helper.rb

Defined Under Namespace

Classes: InvalidSampleSizeError

Constant Summary collapse

DEFAULT_SAMPLE_SIZE =
100

Instance Method Summary collapse

Instance Method Details

#get_sample_size(string) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/rbs/test/setup_helper.rb', line 15

def get_sample_size(string)
  case string
  when ""
    DEFAULT_SAMPLE_SIZE
  when 'ALL'
    nil
  else
    int_size = string.to_i
    raise InvalidSampleSizeError.new(string) unless int_size.positive?
    int_size
  end
end