Skip to content

Commit

Permalink
More rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasfed committed Oct 23, 2023
1 parent 649dcb2 commit 99a0101
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 5 deletions.
4 changes: 3 additions & 1 deletion test/backends/chained_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require File.join(File.dirname(__FILE__), '..', 'test_helper')
require 'globalize/backend/chain'

Expand Down Expand Up @@ -49,7 +51,7 @@ def setup
assert_nothing_raised { I18n.backend.add Globalize::Backend::Dummy.new, Globalize::Backend::Dummy, :dummy }
assert_instance_of Globalize::Backend::Dummy, I18n.backend.send(:backends).first
assert_equal([Globalize::Backend::Dummy, Globalize::Backend::Dummy, Globalize::Backend::Dummy],
I18n.backend.send(:backends).map { |backend| backend.class })
I18n.backend.send(:backends).map(&:class))
end
end

Expand Down
8 changes: 5 additions & 3 deletions test/backends/pluralizing_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require File.join(File.dirname(__FILE__), '..', 'test_helper')
require 'globalize/backend/pluralizing'

Expand All @@ -8,7 +10,7 @@ def setup
if c == 1
:one
else
(2..4).include?(c) ? :few : :other
(2..4).cover?(c) ? :few : :other
end
}
end
Expand All @@ -34,7 +36,7 @@ def setup
if c == 1
:one
else
(2..4).include?(c) ? :few : :other
(2..4).cover?(c) ? :few : :other
end
}
@backend.store_translations :en, foo: { one: 'one en foo', other: 'many en foos' }
Expand All @@ -57,7 +59,7 @@ def setup
if c == 1
:one
else
(2..4).include?(c) ? :few : :other
(2..4).cover?(c) ? :few : :other
end
}
@backend.store_translations :en, foo: { one: 'one en foo', other: 'many en foos' }
Expand Down
2 changes: 2 additions & 0 deletions test/backends/static_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require File.join(File.dirname(__FILE__), '..', 'test_helper')
require 'globalize/backend/static'
require 'globalize/translation'
Expand Down
2 changes: 2 additions & 0 deletions test/i18n/missing_translations_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require File.join(File.dirname(__FILE__), '..', 'test_helper')
require 'globalize/i18n/missing_translations_log_handler'

Expand Down
2 changes: 2 additions & 0 deletions test/load_path_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require_relative 'test_helper'
require 'globalize/load_path'

Expand Down
2 changes: 2 additions & 0 deletions test/locale/active_record_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require File.join(File.dirname(__FILE__), '..', 'test_helper')
require 'globalize/locale/fallbacks'

Expand Down
2 changes: 2 additions & 0 deletions test/locale/fallbacks_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require File.join(File.dirname(__FILE__), '..', 'test_helper')
require 'globalize/locale/fallbacks'

Expand Down
2 changes: 2 additions & 0 deletions test/locale/language_tag_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require File.join(File.dirname(__FILE__), '..', 'test_helper')
require 'globalize/locale/language_tag'

Expand Down
2 changes: 2 additions & 0 deletions test/model/active_record/migration_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')
require 'active_record'
require 'globalize/model/active_record'
Expand Down
2 changes: 1 addition & 1 deletion test/model/active_record/postgres_array_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,6 @@ class PostgresArrayTest < ActiveSupport::TestCase
"}'
array = Globalize::Model::ActiveRecord::PostgresArray.new(string)
assert_equal array.pg_string, string.gsub(/}/, '\}').gsub(/{/, '\{').sub(/\A\\/, '').gsub(/\\}\z/, '}')
assert_equal array.pg_string, string.gsub(/}/, '\}').gsub(/{/, '\{').delete_prefix('\\').gsub(/\\}\z/, '}')
end
end
2 changes: 2 additions & 0 deletions test/model/active_record/sti_translated_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')
require 'active_record'
require 'globalize/model/active_record'
Expand Down
2 changes: 2 additions & 0 deletions test/model/active_record/translated_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')
require 'active_record'
require 'globalize/model/active_record'
Expand Down
2 changes: 2 additions & 0 deletions test/translation_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require_relative 'test_helper'
require 'globalize/translation'

Expand Down

0 comments on commit 99a0101

Please sign in to comment.