Skip to content

normalize path (windows)#3167

Merged
mkristian merged 2 commits intojruby:masterfrom
ahorek:normalize_path
Nov 18, 2015
Merged

normalize path (windows)#3167
mkristian merged 2 commits intojruby:masterfrom
ahorek:normalize_path

Conversation

@ahorek
Copy link
Contributor

@ahorek ahorek commented Jul 22, 2015

fixes #3132

@kares
Copy link
Member

kares commented Jul 30, 2015

@ahorek seems good but without a test is a little less worthy, any chance you do a test-case or tell us what use-case (sample .rb script) has been failing for you that the change fixes? thanks

@ahorek
Copy link
Contributor Author

ahorek commented Jul 30, 2015

@kares - hi, most jruby tests don't work on windows and this is windows specific. Failing scenario is already described in the related issue.

spec/ruby/core/file/realpath_spec.rb
it "returns '/' when passed '/'" do
  File.realpath('/').should == '/'
end

=> for windows it should look something like this:

it "returns '/' when passed '/'" do
  if is_windows?
    File.realpath('/').should == 'C:/' # current behaviour 'C:\'
  else
    File.realpath('/').should == '/' # linux
  end
end

@kares
Copy link
Member

kares commented Nov 13, 2015

seems good ... @mkristian what do you think of: File.realpath('/').should == 'C:/' # NOT 'C:\'

@mkristian
Copy link
Member

the usual java vs. ruby paths. yes, this is OK. still a test which passes on windows as on unix would be great. one there we will have a CI running on windows and then it is important that we have a good test coverage for those windows only cases. test/jruby/test_file.rb is also a good place for such a test as this is in jruby direct control.

@kares
Copy link
Member

kares commented Nov 14, 2015

@mkristian thanks I wasn't sure since its been a while when a tried JRuby on Windows.
shall wait a while if @ahorek decides to add some cases at test/jruby/test_file.rb or merge as is.

@ahorek
Copy link
Contributor Author

ahorek commented Nov 16, 2015

@kares - I've added very simple cases, is it ok? this fix should be also backported to JRuby 1.7.23

@kares
Copy link
Member

kares commented Nov 17, 2015

@ahorek looks good, we're in the process of merging jruby-1_7 into master,
... after we shall merge these and likely even back-port to jruby-1_7. thanks.

mkristian added a commit that referenced this pull request Nov 18, 2015
@mkristian mkristian merged commit 940fe70 into jruby:master Nov 18, 2015
@enebo enebo modified the milestone: Non-Release May 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

expandPathInternal Windows compatibility

4 participants