Skip to content

Commit 2483960

Browse files
committed
Use Ferrum::Utils
1 parent 2dcf606 commit 2483960

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/capybara/cuprite/page.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def dismiss_prompt
6868
end
6969

7070
def find_modal(options)
71-
start = Ferrum.monotonic_time
71+
start = Ferrum::Utils::ElapsedTime.monotonic_time
7272
timeout = options.fetch(:wait, browser.timeout)
7373
expect_text = options[:text]
7474
expect_regexp = expect_text.is_a?(Regexp) ? expect_text : Regexp.escape(expect_text.to_s)
@@ -79,7 +79,7 @@ def find_modal(options)
7979
modal_text = @modal_messages.shift
8080
raise Capybara::ModalNotFound if modal_text.nil? || (expect_text && !modal_text.match(expect_regexp))
8181
rescue Capybara::ModalNotFound => e
82-
raise e, not_found_msg if Ferrum.timeout?(start, timeout)
82+
raise e, not_found_msg if Ferrum::Utils::ElapsedTime.timeout?(start, timeout)
8383

8484
sleep(MODAL_WAIT)
8585
retry

spec/features/driver_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def create_screenshot(file, *args)
518518
expect(@driver.evaluate_script("window.result")).to eq(3)
519519
end
520520

521-
it "supports stopping the session", skip: Ferrum.windows? do
521+
it "supports stopping the session", skip: Ferrum::Utils::Platform.windows? do
522522
driver = Capybara::Cuprite::Driver.new(nil)
523523
pid = driver.browser.process.pid
524524

@@ -1330,7 +1330,7 @@ def create_screenshot(file, *args)
13301330
it "sends sequences with modifiers and symbols" do
13311331
input = @session.find(:css, "#empty_input")
13321332

1333-
keys = Ferrum.mac? ? %i[Alt Left] : %i[Ctrl Left]
1333+
keys = Ferrum::Utils::Platform.mac? ? %i[Alt Left] : %i[Ctrl Left]
13341334

13351335
input.native.send_keys("t", "r", "i", "n", "g", keys, "s")
13361336

@@ -1340,7 +1340,7 @@ def create_screenshot(file, *args)
13401340
it "sends sequences with multiple modifiers and symbols" do
13411341
input = @session.find(:css, "#empty_input")
13421342

1343-
keys = Ferrum.mac? ? %i[Alt Shift Left] : %i[Ctrl Shift Left]
1343+
keys = Ferrum::Utils::Platform.mac? ? %i[Alt Shift Left] : %i[Ctrl Shift Left]
13441344

13451345
input.native.send_keys("t", "r", "i", "n", "g", keys, "s")
13461346

spec/features/session_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@
10351035
end
10361036
end
10371037

1038-
if Ferrum.mri? && !Ferrum.windows?
1038+
if Ferrum::Utils::Platform.mri? && !Ferrum::Utils::Platform.windows?
10391039
require "pty"
10401040
require "timeout"
10411041

0 commit comments

Comments
 (0)