1 30 package org.jruby.test; 31 32 import java.util.ArrayList ; 33 34 import junit.framework.TestCase; 35 36 import org.jruby.Ruby; 37 import org.jruby.RubySymbol; 38 39 public class TestRubySymbol extends TestCase { 40 private Ruby runtime; 41 42 public TestRubySymbol(String name) { 43 super(name); 44 } 45 46 public void setUp() { 47 runtime = Ruby.getDefaultInstance(); 48 runtime.getLoadService().init(new ArrayList ()); 49 } 50 51 public void testSymbolTable() throws Exception { 52 RubySymbol.SymbolTable st = new RubySymbol.SymbolTable(); 53 54 assertNull(st.lookup("somename")); 55 RubySymbol symbol = RubySymbol.newSymbol(runtime, "somename"); 56 st.store(symbol); 57 assertSame(symbol, st.lookup("somename")); 58 } 59 } 60 | Popular Tags |