class RuboCop::Cop::RSpec::SharedExamples::Checker
Constants
- MSG
Attributes
node[R]
Public Class Methods
new(node)
click to toggle source
# File lib/rubocop/cop/rspec/shared_examples.rb, line 51 def initialize(node) @node = node end
Public Instance Methods
message()
click to toggle source
# File lib/rubocop/cop/rspec/shared_examples.rb, line 55 def message format(MSG, prefer: preferred_style, current: symbol.inspect) end
preferred_style()
click to toggle source
# File lib/rubocop/cop/rspec/shared_examples.rb, line 59 def preferred_style string = symbol.to_s.tr('_', ' ') wrap_with_single_quotes(string) end
Private Instance Methods
symbol()
click to toggle source
# File lib/rubocop/cop/rspec/shared_examples.rb, line 66 def symbol node.value end
wrap_with_single_quotes(string)
click to toggle source
# File lib/rubocop/cop/rspec/shared_examples.rb, line 70 def wrap_with_single_quotes(string) "'#{string}'" end