File tree 1 file changed +15
-1
lines changed
src/test/java/org/truffleruby
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1
1
/*
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
3
3
* code is released under a tri EPL/GPL/LGPL license. You can use it,
4
4
* redistribute it and/or modify it under the terms of the:
5
5
*
@@ -218,4 +218,18 @@ public void testTopScopes() {
218
218
assertEquals (formatMethod .execute ("hello" ).asString (), "hello" );
219
219
}
220
220
}
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
+ }
221
235
}
You can’t perform that action at this time.
0 commit comments