I am using Ruby on Rails 3.2.2 and I would like to build a long string the easiest way. I thought of use the times method, but using the following code it doesn’t return that I am looking for:
10000.times{ "Foo bar" }
# => 10000
I would like that it returns "Foo bar Foo bar Foo bar Foo bar Foo bar Foo bar Foo bar Foo bar Foo bar Foo bar ...".
How can I make that?
Note: I would like to use the above code for testing purposes in a my rspec file.
Try this method: