r7kamura / rspec-json_matcher

RSpec matcher for testing JSON string
MIT License
171 stars 10 forks source link

Style/StringLiteralsInInterpolation-20220512231031 #18

Closed github-actions[bot] closed 2 years ago

github-actions[bot] commented 2 years ago

Rubocop challenge!

Style/StringLiteralsInInterpolation

Safe autocorrect: Yes :white_check_mark: The auto-correct a cop does is safe (equivalent) by design.

Description

Overview

This cop checks that quotes inside the string interpolation match the configured preference.

Examples

EnforcedStyle: single_quotes (default)

# bad
result = "Tests #{success ? "PASS" : "FAIL"}"

# good
result = "Tests #{success ? 'PASS' : 'FAIL'}"

EnforcedStyle: double_quotes

# bad
result = "Tests #{success ? 'PASS' : 'FAIL'}"

# good
result = "Tests #{success ? "PASS" : "FAIL"}"

Auto generated by rubocop_challenger