test.rb

Test code that works on Ruby 1.8, segfaults on 1.9.1-p2 - csirac2 (Paul Harvey), 12/14/2008 03:41 pm

Download (312 Bytes)

 
1
class SandBox
2
 def abc(*args)
3
  yield(*args)
4
 end
5
define_method :xyz do
6
 |*args, &block|
7
  puts 'About to call the block:'
8
  block.call(*args)
9
 end
10
end
11
puts 'SandBox.new.abc:'
12
SandBox.new.abc(1,2,3){|*args| p args}  # => [1, 2, 3] 
13
puts 'SandBox.new.xyz:'
14
SandBox.new.xyz(1,2,3){|*args| p args}  # => [1, 2, 3]