Skip to content

Commit 0ac3395

Browse files
committed
add windows guard
1 parent a605a07 commit 0ac3395

File tree

2 files changed

+28
-30
lines changed

2 files changed

+28
-30
lines changed

rb/spec/unit/selenium/webdriver/common/child_process_spec.rb

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,33 @@
2121

2222
module Selenium
2323
module WebDriver
24-
describe ChildProcess, except: [{platform: :windows,
25-
reason: 'This is only for Unix based systems'}] do
26-
it 'does not raise an error when terminating a non-existent process' do
27-
process = described_class.new('sleep', '5')
28-
process.start
29-
30-
pid = process.instance_variable_get(:@pid)
31-
Process.kill('KILL', pid)
32-
Process.wait(pid)
33-
34-
expect {
35-
process.send(:terminate, pid)
36-
}.not_to raise_error
37-
end
38-
39-
it 'does not raise an error when killing a non-existent process' do
40-
process = described_class.new('sleep', '5')
41-
process.start
42-
43-
pid = process.instance_variable_get(:@pid)
44-
Process.kill('KILL', pid)
45-
Process.wait(pid)
46-
47-
expect {
48-
process.send(:kill, pid)
49-
}.not_to raise_error
24+
describe ChildProcess do
25+
unless Selenium::WebDriver::Platform.windows?
26+
it 'does not raise an error when terminating a non-existent process' do
27+
process = described_class.new('sleep', '5')
28+
process.start
29+
30+
pid = process.instance_variable_get(:@pid)
31+
Process.kill('KILL', pid)
32+
Process.wait(pid)
33+
34+
expect {
35+
process.send(:terminate, pid)
36+
}.not_to raise_error
37+
end
38+
39+
it 'does not raise an error when killing a non-existent process' do
40+
process = described_class.new('sleep', '5')
41+
process.start
42+
43+
pid = process.instance_variable_get(:@pid)
44+
Process.kill('KILL', pid)
45+
Process.wait(pid)
46+
47+
expect {
48+
process.send(:kill, pid)
49+
}.not_to raise_error
50+
end
5051
end
5152
end
5253
end

rb/spec/unit/selenium/webdriver/spec_helper.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
require 'securerandom'
3434
require 'pathname'
3535
require_relative '../../../rspec_matchers'
36-
require 'selenium/webdriver/support/guards'
3736

3837
module Selenium
3938
module WebDriver
@@ -63,9 +62,7 @@ def with_env(hash)
6362
c.run_all_when_everything_filtered = true
6463
c.default_formatter = c.files_to_run.count > 1 ? 'progress' : 'doc'
6564

66-
c.before do |example|
67-
guards = Selenium::WebDriver::Support::Guards.new(example, bug_tracker: 'https://github.com/SeleniumHQ/selenium/issues')
68-
guards.add_condition(:platform, Selenium::WebDriver::Platform.os)
65+
c.before do
6966
# https://github.com/ruby/debug/issues/797
7067
allow(File).to receive(:exist?).and_call_original
7168
end

0 commit comments

Comments
 (0)