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

RubyHosting4() public method

public RubyHosting4 ( ) : void
return void
        public void RubyHosting4() {
            Runtime.Globals.SetVariable("foo_bar", 1);
            Engine.Execute(@"
IronRuby.globals.x = 2
IronRuby.globals.z = IronRuby.globals.x + FooBar
");
            Assert(Runtime.Globals.GetVariable<int>("z") == 3);

#if !CLR2
            dynamic scope = Engine.CreateScope();
            Engine.Execute(@"def foo; 1; end", scope);

            RubyMethod method = (RubyMethod)scope.foo;
            Assert(method.Name == "foo");

            object value = scope.foo();
            Assert((int)value == 1);
#endif
        }
Tests