rapid7/metasploit-framework — pull request #3170 by todb-r7 (2014-04-01 19:16:58+00:00)
Title: Use array sample in rex text

This is a follow-on from #2969. Mostly recycled the rspecs since nothing actually changed there.

Looked for other cases in `Rex::Text` where `Array#sample` would be a better fit -- found one where the source of the random set was a string instead of an array, so a) fixed that and b) added a spec around randomize_whitespace.

## Verification Steps

- [ ] See that `rspec spec/lib/rex/text_spec.rb` passes
- [ ] Like #2969, fire up IRB from within an `msfconsole` session and see for yourself reasonable results:
- [ ] Verify that `Rex::Text.rand_name_male` returns a random gender-expected Anglo first name.
- [ ] Verify that `Rex::Text.rand_name_female` returns a random gender-expected Anglo first name.
- [ ] Verify that `Rex::Text.rand_surname` returns a random Anglo surname.
- [ ] Verify that `Rex::Text.rand_name` returns a random Anglo name
- [ ] Verify that `Rex::Text.rand_mail_address` returns a well-formatted e-mail address
- [ ] `a = "here is a string with a bunch of spaces and words."`
- [ ] Verify that `Rex::Text.randomize_space(a)` returns a string with tons of extra funny space characters.