It provides a Random singleton class with a series of methods for generating random test data including names, mailing addresses, dates, phone numbers, e-mail addresses, and text. This lets you quickly mock up realistic looking data for informal testing.
Instead of:
>> foo.name = "John Doe"
You get:>> foo.name = " "
>> foo.name
=> "Miriam R. Xichuan"
The gem also includes code for phone numbers, e-mail addresses, physical addresses, and (primitive) text generation.
You can install it via:
For more details and full documentation, visit the rubyforge site.
sudo gem install random_data
4 comments:
How does one require your gem? I have tried
require 'random_data'
which produced the following error message:
irb(main):002:0> require 'random_data'
LoadError: no such file to load -- random_data
from (irb):2:in `require'
from (irb):2
OK, I resolved the issue. I needed to do the following:
require 'rubygems'
require 'random_data'
glad you were able to get it working! In Ruby 1.9 I believe rubygems is standard, so you won't have to require it separately.
Great plugin.
I posted a bug on rubyforge:
http://rubyforge.org/tracker/index.php?func=detail&aid=22299&group_id=4458&atid=17142
includes a patch.
Post a Comment