Skip to content

Commit dffec89

Browse files
committed
add test
1 parent cb9c29d commit dffec89

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/test/java/org/truffleruby/PolyglotInteropTest.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved. This
2+
* Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved. This
33
* code is released under a tri EPL/GPL/LGPL license. You can use it,
44
* redistribute it and/or modify it under the terms of the:
55
*
@@ -218,4 +218,18 @@ public void testTopScopes() {
218218
assertEquals(formatMethod.execute("hello").asString(), "hello");
219219
}
220220
}
221+
222+
@Test
223+
//GR-27300
224+
public void testTopScopeRemoveBindings() {
225+
try (Context context = Context.create()) {
226+
Value bindings = context.getBindings("ruby");
227+
228+
assertFalse(bindings.hasMember("@foo"));
229+
context.eval("ruby", "@foo=42;");
230+
assertTrue(bindings.hasMember("@foo"));
231+
assertTrue(bindings.removeMember("@foo"));
232+
assertFalse(bindings.hasMember("@foo"));
233+
}
234+
}
221235
}

0 commit comments

Comments
 (0)