public void Dlr_RubyObjects() { var scope = Engine.CreateScope(); Engine.Execute(@" scope.ruby_array = [100, 200] scope.ruby_hash = { 1 => 3, 2 => 4 } def inc(a) a + 1 end scope.ruby_method = method(:inc) scope.ruby_proc = proc { |a| a + 2 } ", scope); #if !CLR2 dynamic s = scope; AreEqual(s.ruby_array[0], 100); AreEqual(s.ruby_hash[1], 3); AreEqual(s.ruby_method(1), 2); AreEqual(s.ruby_proc(1), 3); #endif object method = scope.GetVariable("ruby_method"); AreEqual(MyInvokeBinder.Invoke(method, 1), 2); object proc = scope.GetVariable("ruby_proc"); AreEqual(MyInvokeBinder.Invoke(proc, 1), 3); }