out = new PrintStream(new ByteArrayOutputStream());
err = new PrintStream(new ByteArrayOutputStream());
}
public void testParsing() {
RubyInstanceConfig c = new RubyInstanceConfig();
c.processArguments(new String[]{"-e", "hello", "-e", "world"});
assertEquals("hello\nworld\n", new String(c.inlineScript()));
assertNull(c.getScriptFileName());
assertEquals("-e", c.displayedFileName());
c = new RubyInstanceConfig();
c.processArguments(new String[]{"--version"});
assertTrue(c.isShowVersion());
c = new RubyInstanceConfig();
c.processArguments(new String[]{"-n", "myfile.rb"});
assertTrue(c.isAssumeLoop());
assertEquals("myfile.rb", c.getScriptFileName());
assertEquals("myfile.rb", c.displayedFileName());
c = new RubyInstanceConfig();
c.processArguments(new String[0]);
assertEquals("-", c.displayedFileName());
}