Class: RuboCop::Cop::Salsify::RspecStringLiterals

Inherits:
RuboCop::Cop
  • Object
show all
Includes:
ConfigurableEnforcedStyle, StringLiteralsHelp
Defined in:
lib/rubocop/cop/salsify/rspec_string_literals.rb

Overview

This cop checks if quotes match the configured preference. It is intended to be use specifically for specs and in combination with Salsify/RspecDocString.

Used together with Salsify/RspecDocString it allows one quote style to be used for doc strings (‘describe “foobar”`) and another style to be used for all other strings in specs.

Constant Summary collapse

DOCUMENTED_METHODS =
RuboCop::Cop::Salsify::RspecDocString::DOCUMENTED_METHODS
SINGLE_QUOTE_MSG =
'Prefer single-quoted strings unless you need ' \
'interpolation or special symbols.'.freeze
DOUBLE_QUOTE_MSG =
'Prefer double-quoted strings unless you need ' \
'single quotes to avoid extra backslashes for escaping.'.freeze