Skip to content

Commit b571cd7

Browse files
committed
[rb] setting log value does not apply to Safari
this is easier than implementing log separately in each of the other service classes
1 parent 1a914bf commit b571cd7

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

rb/lib/selenium/webdriver/safari/service.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ class Service < WebDriver::Service
2424
DEFAULT_PORT = 7050
2525
EXECUTABLE = 'safaridriver'
2626
SHUTDOWN_SUPPORTED = false
27+
28+
def initialize(path: nil, port: nil, log: nil, args: nil)
29+
raise Error::WebDriverError, 'Safari Service does not support setting log output' if log
30+
31+
super
32+
end
33+
34+
def log=(*)
35+
raise Error::WebDriverError, 'Safari Service does not support setting log output'
36+
end
2737
end # Service
2838
end # Safari
2939
end # WebDriver

rb/spec/unit/selenium/webdriver/safari/service_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ module Safari
3030
allow(Platform).to receive(:assert_executable).and_return(true)
3131
end
3232

33+
it 'does not allow log' do
34+
expect {
35+
described_class.new(log: 'anywhere')
36+
}.to raise_exception(Error::WebDriverError, 'Safari Service does not support setting log output')
37+
end
38+
3339
it 'uses default port and nil path' do
3440
service = described_class.new
3541

@@ -57,6 +63,13 @@ module Safari
5763
expect(service.extra_args).to be_empty
5864
end
5965

66+
it 'does not allow log=' do
67+
service = described_class.new
68+
expect {
69+
service.log = 'anywhere'
70+
}.to raise_exception(Error::WebDriverError, 'Safari Service does not support setting log output')
71+
end
72+
6073
it 'uses provided args' do
6174
allow(Platform).to receive(:find_binary).and_return(service_path)
6275

0 commit comments

Comments
 (0)