1 28 29 package org.jruby.test; 30 31 import java.util.ArrayList ; 32 33 import org.jruby.Ruby; 34 import org.jruby.runtime.load.LoadService; 35 36 37 public class TestLoadService extends TestRubyBase { 38 39 private LoadService loadService; 40 public void setUp() { 41 runtime = Ruby.getDefaultInstance(); 42 loadService = (LoadService) runtime.getLoadService(); 43 44 loadService.init(new ArrayList ()); 45 } 46 47 public void testRequireSocket() { 48 runtime.evalScript("require 'socket'"); 49 } 50 51 public void testExtensionLoader() { 52 BasicLibraryTestService.counter = 0; 53 runtime.evalScript("require 'org/jruby/test/basic_library_test'"); 54 assertEquals("The library should've have been loaded", BasicLibraryTestService.counter, 1); 55 } 56 } 57 | Popular Tags |