Examples of processArguments()


Examples of org.jruby.RubyInstanceConfig.processArguments()

    }

    public void testHelpDoesNotRunIntepreter() {
        String[] args = new String[]{"-h"};
        RubyInstanceConfig parser = new RubyInstanceConfig();
        parser.processArguments(args);
        assertFalse(parser.isShouldRunInterpreter());

        args = new String[]{"--help"};
        parser = new RubyInstanceConfig();
        parser.processArguments(args);
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

        parser.processArguments(args);
        assertFalse(parser.isShouldRunInterpreter());

        args = new String[]{"--help"};
        parser = new RubyInstanceConfig();
        parser.processArguments(args);
        assertFalse(parser.isShouldRunInterpreter());
    }

    public void testCommandTakesOneArgument() {
        String[] args = new String[]{"--command", "gem"};
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

    }

    public void testCommandTakesOneArgument() {
        String[] args = new String[]{"--command", "gem"};
        RubyInstanceConfig parser = new RubyInstanceConfig();
        parser.processArguments(args);
        assertNotNull(parser.getScriptFileName());
    }

    public void testCommandAllowedOnlyOnceAndRemainderAreScriptArgs() {
        String[] args = new String[]{"--command", "gem", "--command", "irb"};
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

    }

    public void testCommandAllowedOnlyOnceAndRemainderAreScriptArgs() {
        String[] args = new String[]{"--command", "gem", "--command", "irb"};
        RubyInstanceConfig parser = new RubyInstanceConfig();
        parser.processArguments(args);
        assertEquals(2, parser.getArgv().length);
        assertEquals("--command", parser.getArgv()[0]);
        assertEquals("irb", parser.getArgv()[1]);
    }
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

    }

    public void testCommandExtractScript() {
        String[] args = new String[] { "-xtest", "testDoc.foo"};
        RubyInstanceConfig parser = new RubyInstanceConfig();
        parser.processArguments(args);
        assertEquals(true, parser.isxFlag());
        assertEquals("testDoc.foo", parser.getScriptFileName());
    }
}
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

        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();
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

        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());
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

        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();
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

        assertTrue(c.isAssumeLoop());
        assertEquals("myfile.rb", c.getScriptFileName());
        assertEquals("myfile.rb", c.displayedFileName());

        c = new RubyInstanceConfig();
        c.processArguments(new String[0]);
        assertEquals("-", c.displayedFileName());
    }

    public void testParsingWithDashDash() {
        class TestableCommandlineParser extends RubyInstanceConfig {
View Full Code Here

Examples of org.jruby.RubyInstanceConfig.processArguments()

    }

    public void testHelpDoesNotRunIntepreter() {
        String[] args = new String[]{"-h"};
        RubyInstanceConfig parser = new RubyInstanceConfig();
        parser.processArguments(args);
        assertFalse(parser.getShouldRunInterpreter());

        args = new String[]{"--help"};
        parser = new RubyInstanceConfig();
        parser.processArguments(args);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.