IronRuby.Tests.Tests.RubyHosting2 C# (CSharp) Method

RubyHosting2() public method

public RubyHosting2 ( ) : void
return void
        public void RubyHosting2() {
            Hashtable hash = new Hashtable();
            hash.Add("foo", "bar");
            
            ScriptScope scope = Engine.CreateScope();
            scope.SetVariable("h", hash);

            AssertOutput(() => 
                Engine.Execute(@"
def h.method_missing name
  get_Item(name.to_clr_string)
end

puts h.foo
", scope), @"
bar
");
        }
Tests