Skip to content

Commit

Permalink
Bump rubocop to 1.40.0 and Fix Style/RedundantRegexpEscape RuboCop of…
Browse files Browse the repository at this point in the history
…fense (#2656)

* BUmp rubocop to 1.40.0

* Fix Style/RedundantRegexpEscape RuboCop offense

[dependabot opened a PR](#2650)
to bump rubocop's version but it failed CI because there were some
test files that needed to be corrected.
  • Loading branch information
stefannibrasil committed Dec 20, 2022
1 parent 7df22a4 commit 63e5639
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ GEM
rake (13.0.6)
regexp_parser (2.6.1)
rexml (3.2.5)
rubocop (1.38.0)
rubocop (1.40.0)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.1.2.1)
Expand Down Expand Up @@ -66,7 +66,7 @@ DEPENDENCIES
minitest (= 5.16.3)
pry (= 0.14.1)
rake (= 13.0.6)
rubocop (= 1.38.0)
rubocop (= 1.40.0)
rubocop-minitest (= 0.25.0)
rubocop-rake (= 0.6.0)
simplecov (= 0.21.2)
Expand Down
2 changes: 1 addition & 1 deletion faker.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency('minitest', '5.16.3')
spec.add_development_dependency('pry', '0.14.1')
spec.add_development_dependency('rake', '13.0.6')
spec.add_development_dependency('rubocop', '1.38.0')
spec.add_development_dependency('rubocop', '1.40.0')
spec.add_development_dependency('rubocop-minitest', '0.25.0')
spec.add_development_dependency('rubocop-rake', '0.6.0')
spec.add_development_dependency('simplecov', '0.21.2')
Expand Down
2 changes: 1 addition & 1 deletion test/faker/default/test_faker_compass.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def setup
@tester = Faker::Compass
@word_pattern = /\w+/
@multiword_pattern = /^\w+ by \w+$/
@combined_pattern = /^(?:\w+|\w+ by \w+|[\w\-]+)$/
@combined_pattern = /^(?:\w+|\w+ by \w+|[\w-]+)$/
@number_pattern = /^\d+(?:.\d\d?)?$/
@letter_pattern = /^[NEWS]?[NEWS](?:b?[NEWS])?$/
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_da_dk_locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ def test_da_dk_name_methods

def test_da_dk_phone_number_methods
assert_match(/(20)|(30)|(40)[\d\s]+$/, Faker::PhoneNumber.cell_phone)
assert_match(/(\d\d[\s\-]?){4}$/, Faker::PhoneNumber.phone_number)
assert_match(/(\d\d[\s-]?){4}$/, Faker::PhoneNumber.phone_number)
end
end
2 changes: 1 addition & 1 deletion test/test_es_ar_locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def test_es_ar_quarter_wind
end

def test_es_ar_direction
assert_match(/^(?:\w+|\w+ por el \w+|[\w\-]+)$/u, Faker::Compass.direction)
assert_match(/^(?:\w+|\w+ por el \w+|[\w-]+)$/u, Faker::Compass.direction)
end

def test_es_ar_abbreviation
Expand Down
4 changes: 2 additions & 2 deletions test/test_fi_locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_fi_invoice_methods
end

def test_fi_phone_number
assert_match(/0\d{2}[\-\s]?\d{6}/, Faker::PhoneNumber.cell_phone)
assert_match(/\d{2,3}[\s\-]?\d{5,6}/, Faker::PhoneNumber.phone_number)
assert_match(/0\d{2}[-\s]?\d{6}/, Faker::PhoneNumber.cell_phone)
assert_match(/\d{2,3}[\s-]?\d{5,6}/, Faker::PhoneNumber.phone_number)
end
end
2 changes: 1 addition & 1 deletion test/test_pt_br_locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_pt_br_food_methods

def test_pt_br_internet_methods
assert Faker::Internet.free_email.is_a? String
assert_match(/^[a-z0-9._\-]+@[a-z0-9]+.[a-z]+.([a-z]+)?$/i, Faker::Internet.free_email)
assert_match(/^[a-z0-9._-]+@[a-z0-9]+.[a-z]+.([a-z]+)?$/i, Faker::Internet.free_email)

assert Faker::Internet.domain_suffix.is_a? String
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_pt_locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ def test_pt_name_methods
end

def test_pt_phone_number
assert_match(/^(\+351)?[()\d\s\-]+$/, Faker::PhoneNumber.phone_number)
assert_match(/^(\+351)?[()\d\s-]+$/, Faker::PhoneNumber.phone_number)
end
end
4 changes: 2 additions & 2 deletions test/test_sv_locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def test_sv_name_methods
end

def test_sv_phone_number_methods
assert_match(/^07[036]{1}[\-\s]?\d{3}[\-\s]?\d{4}$/, Faker::PhoneNumber.cell_phone)
assert_match(/^\d{4}[\s\-]?\d{4,6}$/, Faker::PhoneNumber.phone_number)
assert_match(/^07[036]{1}[-\s]?\d{3}[-\s]?\d{4}$/, Faker::PhoneNumber.cell_phone)
assert_match(/^\d{4}[\s-]?\d{4,6}$/, Faker::PhoneNumber.phone_number)
end

def test_sv_team_methods
Expand Down

0 comments on commit 63e5639

Please sign in to comment.