mhutter/teamdrive_api

View on GitHub
test/teamdrive_api/core_ext/hash_test.rb

Summary

Maintainability
A
0 mins
Test Coverage

Freeze mutable objects assigned to constants.
Open

  BEFORE = {
    'foo' => 'bar',
    'num' => {
      'first' => 1,
      'second' => 2

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

Freeze mutable objects assigned to constants.
Open

  EXPECTED = {
    foo: 'bar',
    num: {
      first: 1,
      second: 2

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

There are no issues that match your filters.

Category
Status