Skip to content

Commit 4f02032

Browse files
committed
Fix CI: use File.expand_path for test requires in -e context
Dir glob returns relative paths like "test/test_cache.rb". Plain require looks for these relative to load paths (-Itest), resulting in "test/test/test_cache.rb". Using File.expand_path converts to absolute paths which resolve correctly. https://claude.ai/code/session_01CvCNpdSjh1STBdmS9n5DN9
1 parent 3eee14f commit 4f02032

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
ruby-version: ${{ matrix.ruby-version }}
2525

2626
- name: Run tests
27-
run: ruby -Ilib -Itest -e "Dir['test/test_*.rb'].each { |f| require f }"
27+
run: ruby -Ilib -Itest -e "Dir['test/test_*.rb'].each { |f| require File.expand_path(f) }"
2828

2929
- name: Verify gem builds
3030
run: gem build ipdata.gemspec

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
ruby-version: "3.3"
7676

7777
- name: Run tests
78-
run: ruby -Ilib -Itest -e "Dir['test/test_*.rb'].each { |f| require f }"
78+
run: ruby -Ilib -Itest -e "Dir['test/test_*.rb'].each { |f| require File.expand_path(f) }"
7979

8080
- name: Build gem
8181
run: gem build ipdata.gemspec

0 commit comments

Comments
 (0)