spec/watirspec/cookies_spec.rb in watir-7.1.0 vs spec/watirspec/cookies_spec.rb in watir-7.2.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
require 'watirspec_helper'
describe 'Browser#cookies' do
after { browser.cookies.clear }
@@ -131,19 +133,19 @@
browser.cookies.save file
end
describe '#save' do
it 'saves cookies to file' do
- expect(IO.read(file)).to eq(browser.cookies.to_a.to_yaml)
+ expect(File.read(file)).to eq(browser.cookies.to_a.to_yaml)
end
end
describe '#load', except: {browser: :ie} do
it 'loads cookies from file' do
browser.cookies.clear
browser.cookies.load file
expected = browser.cookies.to_a
- actual = YAML.safe_load(IO.read(file), [::Symbol])
+ actual = YAML.safe_load(File.read(file), permitted_classes: [Symbol])
expected.each { |cookie| cookie.delete(:expires) }
actual.each { |cookie| cookie.delete(:expires) }
expect(actual).to eq(expected)