Skip to content

Commit

Permalink
tidy up spec guards
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Dec 16, 2018
1 parent 3e94fb6 commit d06e06b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion spec/watirspec/alert_spec.rb
Expand Up @@ -10,7 +10,7 @@
browser.alert.ok if browser.alert.exists?
end

not_compliant_on :not_relaxed_locate do
compliant_on :relaxed_locate do
context 'Relaxed Waits' do
context 'when acting on an alert' do
it 'raises exception after timing out' do
Expand Down
2 changes: 1 addition & 1 deletion spec/watirspec/relaxed_locate_spec.rb
@@ -1,7 +1,7 @@
require 'watirspec_helper'

describe 'Watir#relaxed_locate?' do
not_compliant_on :not_relaxed_locate do
compliant_on :relaxed_locate do
context 'when true' do
before :each do
browser.goto(WatirSpec.url_for('wait.html'))
Expand Down
12 changes: 6 additions & 6 deletions spec/watirspec_helper.rb
Expand Up @@ -82,15 +82,15 @@ def add_guards
end

def common_guards
matching_guards = [:webdriver]

matching_guards << browser
matching_guards = [browser]
matching_guards << [browser, Selenium::WebDriver::Platform.os]
matching_guards << :relaxed_locate if Watir.relaxed_locate?
matching_guards << :not_relaxed_locate unless Watir.relaxed_locate?
matching_guards << :headless if @imp.browser_args.last[:headless]
matching_guards << :appveyor if ENV['APPVEYOR']
matching_guards << [browser, :appveyor] if ENV['APPVEYOR']
# TODO: Replace this with Selenium::WebDriver::Platform.ci after next Selenium Release
if ENV['APPVEYOR']
matching_guards << :appveyor
matching_guards << [browser, :appveyor]
end

if !Selenium::WebDriver::Platform.linux? || ENV['DESKTOP_SESSION']
# some specs (i.e. Window#maximize) needs a window manager on linux
Expand Down

0 comments on commit d06e06b

Please sign in to comment.