Skip to content

In windows ScriptingContainerTest fails #2964

@cshupp1

Description

@cshupp1

In windows the test testGetCurrentDirectory in ScriptingContainer fails as follows:

org.junit.ComparisonFailure: expected:<C:[\Users\Cris\IdeaProjects\jruby\]core> but was:<C:[/Users/Cris/IdeaProjects/jruby/]core>
        at org.junit.Assert.assertEquals(Assert.java:115)
        at org.junit.Assert.assertEquals(Assert.java:144)
        at org.jruby.embed.ScriptingContainerTest.testGetCurrentDirectory(ScriptingContainerTest.java:1914)

The bug appears to be here (org.jruby.util.JRubyFile):

    public static String normalizeSeps(String path) {
        if (Platform.IS_WINDOWS) {
            return path.replace(File.separatorChar, '/');
        } else {
            return path;
        }

The order of replace is backwards, changing to:

   public static String normalizeSeps(String path) {
        if (Platform.IS_WINDOWS) {
            return path.replace('/', File.separatorChar);
        } else {
            return path;
        }
    }

With your permission my coding partner and I would like to use this simple issue to attempt our first contribution to JRuby. Is there a check in guide we should read?

Thanks,

Cris and Greg

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions