From cd199105ea39a58f4e3ee251eadba079bde942d6 Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Tue, 15 Oct 2019 18:06:45 -0700 Subject: [PATCH] Fix miscellaneous new Rubocop issues --- lib/capybara/selector/css.rb | 2 +- spec/result_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/capybara/selector/css.rb b/lib/capybara/selector/css.rb index 820d288a..d4f39632 100644 --- a/lib/capybara/selector/css.rb +++ b/lib/capybara/selector/css.rb @@ -15,7 +15,7 @@ module Capybara end def self.escape_char(char) - char.match?(%r{[ -/:-~]}) ? "\\#{char}" : format('\\%06x', char.ord) + char.match?(%r{[ -/:-~]}) ? "\\#{char}" : format('\\%06x', hex: char.ord) end def self.split(css) diff --git a/spec/result_spec.rb b/spec/result_spec.rb index 1e26c7d3..43d0f6ef 100644 --- a/spec/result_spec.rb +++ b/spec/result_spec.rb @@ -44,9 +44,9 @@ RSpec.describe Capybara::Result do end it 'can be selected' do - expect(result.select do |element| + expect(result.count do |element| element.text.include? 't' - end.length).to eq(2) + end).to eq(2) end it 'can be reduced' do