spec/rails_helper.rb

Summary

Maintainability
A
0 mins
Test Coverage

Use expand_path('../config/environment', __dir__) instead of expand_path('../../config/environment', __FILE__).
Open

require File.expand_path('../../config/environment', __FILE__)
Severity: Minor
Found in spec/rails_helper.rb by rubocop

Checks for use of the File.expand_path arguments. Likewise, it also checks for the Pathname.new argument.

Contrastive bad case and good case are alternately shown in the following examples.

Example:

# bad
File.expand_path('..', __FILE__)

# good
File.expand_path(__dir__)

# bad
File.expand_path('../..', __FILE__)

# good
File.expand_path('..', __dir__)

# bad
File.expand_path('.', __FILE__)

# good
File.expand_path(__FILE__)

# bad
Pathname(__FILE__).parent.expand_path

# good
Pathname(__dir__).expand_path

# bad
Pathname.new(__FILE__).parent.expand_path

# good
Pathname.new(__dir__).expand_path

Do not use :: for method calls.
Open

    TestServices::create_collections_index
Severity: Minor
Found in spec/rails_helper.rb by rubocop

Checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

Example:

# bad
Timeout::timeout(500) { do_something }
FileUtils::rmdir(dir)
Marshal::dump(obj)

# good
Timeout.timeout(500) { do_something }
FileUtils.rmdir(dir)
Marshal.dump(obj)

Do not use :: for method calls.
Open

    TestServices::delete_es_indexes
Severity: Minor
Found in spec/rails_helper.rb by rubocop

Checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

Example:

# bad
Timeout::timeout(500) { do_something }
FileUtils::rmdir(dir)
Marshal::dump(obj)

# good
Timeout.timeout(500) { do_something }
FileUtils.rmdir(dir)
Marshal.dump(obj)

Do not use :: for method calls.
Open

    TestServices::delete_es_indexes
Severity: Minor
Found in spec/rails_helper.rb by rubocop

Checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

Example:

# bad
Timeout::timeout(500) { do_something }
FileUtils::rmdir(dir)
Marshal::dump(obj)

# good
Timeout.timeout(500) { do_something }
FileUtils.rmdir(dir)
Marshal.dump(obj)

There are no issues that match your filters.

Category
Status