Skip to content

Commit

Permalink
Debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
robotdana committed Nov 17, 2023
1 parent 1267d50 commit 223ec20
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [2.7, '3.0', 3.1, 3.2, ruby-head, jruby-9.4, jruby-head]
ruby: [2.7, '3.0', 3.1, 3.2, 3.3, ruby-head, jruby-9.4, jruby-head]
platform: [ubuntu, windows, macos]
continue-on-error: ${{ endsWith(matrix.ruby, 'head') }}
runs-on: ${{matrix.platform}}-latest
Expand Down
5 changes: 3 additions & 2 deletions lib/path_list/candidate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ def children
end

# :nocov:
if ::RUBY_PLATFORM == 'jruby' && ::RbConfig::CONFIG['host_os'].match?(/mswin|mingw/)
if ::RUBY_PLATFORM == 'java' && ::RbConfig::CONFIG['host_os'].match?(/mswin|mingw/)
# @return [Boolean] whether this path is a directory (false for symlinks to directories)
puts 'WE ARE WINDOWS JRUBY'
def directory?
return @directory unless @directory.nil?

@directory = if ::File.symlink?(@full_path)
warn 'Symlink lstat'
warn lstat.inspect
false
else
lstat&.directory? || false
Expand Down
3 changes: 2 additions & 1 deletion spec/candidate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@

candidate = described_class.new(File.expand_path('foo'))
expect(File.symlink?('./foo')).to be true
# expect(candidate.send(:lstat)).to have_attributes(directory?: false, symlink?: true)
expect(File.stat('./foo')).to have_attributes(directory?: false, symlink?: true)
expect(candidate.send(:lstat)).to have_attributes(directory?: false, symlink?: true)
expect(candidate).not_to be_directory
end
end
Expand Down
4 changes: 3 additions & 1 deletion spec/path_list_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@
end

it "doesn't rescue the yielded block" do
expect { subject.each { |x| File.read(x) } }.to raise_error(Errno::ELOOP)
# jruby windows does enoent here. i don't know why
expect { subject.each { |x| File.read(x) } }
.to raise_error(be_a(Errno::ELOOP).or(be_a(Errno::ENOENT)))
end
end

Expand Down

0 comments on commit 223ec20

Please sign in to comment.