Skip to content

Commit 04ede9e

Browse files
committed
Add support for TruffleRuby
1 parent 969b734 commit 04ede9e

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

.github/workflows/ci-ruby.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ jobs:
186186
strategy:
187187
fail-fast: false
188188
matrix:
189-
ruby: [ '2.7.6', '3.1.2' ]
189+
ruby: [ '2.7.6', '3.1.2', 'truffleruby-22.3.0' ]
190190
steps:
191191
- name: Checkout source tree
192192
uses: actions/checkout@v2

rb/lib/selenium/webdriver/common/platform.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ def jruby?
7878
engine == :jruby
7979
end
8080

81+
def truffleruby?
82+
engine == :truffleruby
83+
end
84+
8185
def ruby_version
8286
RUBY_VERSION
8387
end

rb/spec/integration/selenium/webdriver/spec_support/rack_server.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def initialize(path, port = nil)
3535
end
3636

3737
def start
38-
if Platform.jruby? || Platform.windows?
38+
if Platform.jruby? || Platform.windows? || Platform.truffleruby?
3939
start_threaded
4040
else
4141
start_forked

rb/spec/unit/selenium/webdriver/file_reaper_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module WebDriver
5656
expect(tmp_file).to exist
5757
end
5858

59-
unless Platform.jruby? || Platform.windows?
59+
unless Platform.jruby? || Platform.windows? || Platform.truffleruby?
6060
it 'reaps files only for the current pid' do
6161
expect(tmp_file).to exist
6262

rb/spec/unit/selenium/webdriver/socket_poller_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def poller(port)
4949
wait = Time.parse('2010-01-01 00:00:04')
5050
stop = Time.parse('2010-01-01 00:00:06')
5151

52-
expect(Process).to receive(:clock_gettime).and_return(start, wait, stop)
52+
allow(Process).to receive(:clock_gettime).and_return(start, wait, stop)
5353
expect(poller(9251)).not_to be_connected
5454
end
5555
end
@@ -64,7 +64,7 @@ def poller(port)
6464
wait = Time.parse('2010-01-01 00:00:04').to_f
6565
stop = Time.parse('2010-01-01 00:00:06').to_f
6666

67-
expect(Process).to receive(:clock_gettime).and_return(start, wait, stop)
67+
allow(Process).to receive(:clock_gettime).and_return(start, wait, stop)
6868
expect(poller(9250)).not_to be_closed
6969
end
7070
end

0 commit comments

Comments
 (0)