Skip to content

Commit

Permalink
Merge pull request #14174 from krauselukas/rubocop/tackle_style_strin…
Browse files Browse the repository at this point in the history
…g_concationation_01

Fix Style/StringConcatenation rubocop offense in `test/test_helper` and `/test/unit/*`
  • Loading branch information
hennevogel authored Apr 17, 2023
2 parents 4b21711 + 5d9b1d0 commit a8ba756
Show file tree
Hide file tree
Showing 26 changed files with 27 additions and 51 deletions.
25 changes: 0 additions & 25 deletions src/api/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -342,31 +342,6 @@ Style/StringConcatenation:
- 'test/functional/zzz_post_consistency_test.rb'
- 'test/integration/last_events_test.rb'
- 'test/test_consistency_helper.rb'
- 'test/test_helper.rb'
- 'test/unit/attrib_test.rb'
- 'test/unit/attribute_test.rb'
- 'test/unit/binary_release.rb'
- 'test/unit/bs_request_test.rb'
- 'test/unit/build_flag_test.rb'
- 'test/unit/channel_test.rb'
- 'test/unit/debug_flag_test.rb'
- 'test/unit/flag_test.rb'
- 'test/unit/groups_users_test.rb'
- 'test/unit/issue_test.rb'
- 'test/unit/linked_project_test.rb'
- 'test/unit/package_group_role_relationship_test.rb'
- 'test/unit/package_remove_test.rb'
- 'test/unit/package_test.rb'
- 'test/unit/patchinfo_test.rb'
- 'test/unit/product_test.rb'
- 'test/unit/project_remove_test.rb'
- 'test/unit/project_test.rb'
- 'test/unit/public_helper_test.rb'
- 'test/unit/publish_flag_test.rb'
- 'test/unit/status_helper_test.rb'
- 'test/unit/user_ldap_strategy_test.rb'
- 'test/unit/validator_test.rb'
- 'test/unit/watched_item_test.rb'

##################### Metrics ##################################

Expand Down
5 changes: 3 additions & 2 deletions src/api/test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def login_king(opts = {})

teardown do
dirpath = Rails.root.join('tmp', 'capybara')
htmlpath = dirpath.join(name + '.html')
htmlpath = dirpath.join("#{name}.html")
if !passed?
Dir.mkdir(dirpath) unless Dir.exist?(dirpath)
save_page(htmlpath)
Expand Down Expand Up @@ -254,7 +254,8 @@ def basic_auth
end

def prepare_request_with_user(user, passwd)
@@auth = 'Basic ' + Base64.encode64(user + ':' + passwd)
basic_auth_credentials = "#{user}:#{passwd}"
@@auth = "Basic #{Base64.encode64(basic_auth_credentials)}"
end

# will provide a user without special permissions
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/attrib_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class AttribTest < ActiveSupport::TestCase
fixtures :all
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/attribute_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class AttributeTest < ActiveSupport::TestCase
fixtures :all
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/binary_release.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class BinaryReleaseTest < ActiveSupport::TestCase
fixtures :all
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/bs_request_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class BsRequestTest < ActiveSupport::TestCase
fixtures :all
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/build_flag_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class BuildFlagTest < ActiveSupport::TestCase
fixtures :all
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/channel_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class ChannelTest < ActiveSupport::TestCase
fixtures :all
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/debug_flag_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class DebuginfoFlagTest < ActiveSupport::TestCase
fixtures :all
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/flag_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class FlagTest < ActiveSupport::TestCase
fixtures :all
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/groups_users_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class GroupUsersTest < ActiveSupport::TestCase
fixtures :groups, :users, :groups_users
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/issue_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class IssueTest < ActiveSupport::TestCase
fixtures :all
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/linked_project_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class LinkedProjectTest < ActiveSupport::TestCase
fixtures :linked_projects, :projects
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/package_group_role_relationship_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class PackageGroupRoleRelationshipTest < ActiveSupport::TestCase
def test_validation
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/package_remove_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Testing the things that should and shouldn't happen when you remove a Package
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class PackageRemoveTest < ActiveSupport::TestCase
fixtures :all
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/package_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

SimpleCov.command_name('minitest')

Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/patchinfo_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'
require 'json'

class PatchinfoTest < ActiveSupport::TestCase
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/product_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'
require 'json'

class ProductTest < ActiveSupport::TestCase
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/project_remove_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Testing the things that should and shouldn't happen when you remove a Project
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'
require 'securerandom'

class ProjectRemoveTest < ActiveSupport::TestCase
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/project_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'
require 'json'
# require '/usr/lib64/ruby/gems/1.9.1/gems/perftools.rb-2.0.0/lib/perftools.so'

Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/public_helper_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class PublicHelperTest < ActiveSupport::TestCase
YMP_URL = 'http://example.com/ymp'.freeze
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/publish_flag_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class PublishFlagTest < ActiveSupport::TestCase
fixtures :all
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/status_helper_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class StatusHelperTest < ActiveSupport::TestCase
test 'resample' do
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/user_ldap_strategy_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_authenticate_with_local # spec/models/user_ldap_strategy_spec.rb
test_entry = {
'userPassword' => [],
'CLR_userPassword' => ['test'],
'MD5_userPassword' => ['{MD5}' + Base64.encode64(Digest::MD5.digest('test'))]
'MD5_userPassword' => ["{MD5}#{Base64.encode64(Digest::MD5.digest('test'))}"]
}

CONFIG['ldap_auth_mech'] = :foobar
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/validator_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class ValidatorTest < ActiveSupport::TestCase
def test_arguments
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/unit/watched_item_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/..') + '/test_helper'
require_relative '../test_helper'

class WatchedItemTest < ActiveSupport::TestCase
fixtures :all
Expand Down

0 comments on commit a8ba756

Please sign in to comment.