Here is a useful bundle for testing out ruby snippets. It includes a script from eigenclass.org[1].
⌘= insert/remove an eval marker for the current line ⌘E evaluates and annotate the file according to the markers
If there are errors they are placed at the end of the file.
Examples (after eval):
(1..10).each do |i| i ** i # => 1, 4, 27, 256, 3125, 46656, 823543, 16777216, 387420489, 10000000000 end (1..10).to_a # => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Unfortunately you can't do something like this:
(1..10).each do |i| i ** i end # =>
[1]: http://eigenclass.org/hiki.rb?xmp+redux%3A+expanding+test +assertions+for+profit
-- Daniel