module OLE_QA::Framework::Factory_Helpers
This mix-in module contains helper methods for other data factory modules.
Private Instance Methods
name_builder(len = 8)
click to toggle source
# File lib/module/factory_helpers.rb, line 18 def name_builder(len = 8) out = Array.new out << sampler len -= 1 len.times do out << sampler('a'..'z') end out.join end
num_str(len = 8)
click to toggle source
# File lib/module/factory_helpers.rb, line 41 def num_str(len = 8) ary = Array.new len.times { ary << sampler('0'..'9') } ary.join end
sampler(r = 'A'..'Z')
click to toggle source
# File lib/module/factory_helpers.rb, line 29 def sampler(r = 'A'..'Z') r.to_a.sample end
str(len=8)
click to toggle source
# File lib/module/factory_helpers.rb, line 34 def str(len=8) ary = Array.new len.times { ary << sampler('a'..'z') } ary.join end