Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Word generator for ruby testing

Tags:

ruby

testing

Does someone know of a good ruby testing library for generating English (or maybe also those Latin "lorem ipsum") words? Another nice thing would be to specify some additional options (e.g. the word length, only use names). Does such a thing exist?

like image 998
Zardoz Avatar asked Dec 03 '22 11:12

Zardoz


1 Answers

Check out Faker. For example,

ruby-1.8.7-p302 > Faker::Lorem.sentence
  => "Enim molestiae incidunt rem ipsum perferendis beatae excepturi tenetur."
ruby-1.8.7-p302 > Faker::Name.name
  => "Agnes Hand II"
like image 85
sluukkonen Avatar answered Dec 06 '22 00:12

sluukkonen