lib/rubocop/cop/rspec/variable_definition.rb in rubocop-rspec-1.42.0 vs lib/rubocop/cop/rspec/variable_definition.rb in rubocop-rspec-1.43.0
- old
+ new
@@ -5,26 +5,26 @@
module RSpec
# Checks that memoized helpers names are symbols or strings.
#
# @example EnforcedStyle: symbols (default)
# # bad
- # let('user_name') { 'Adam' }
# subject('user') { create_user }
+ # let('user_name') { 'Adam' }
#
# # good
- # let(:user_name) { 'Adam' }
# subject(:user) { create_user }
+ # let(:user_name) { 'Adam' }
#
# @example EnforcedStyle: strings
# # bad
- # let(:user_name) { 'Adam' }
# subject(:user) { create_user }
+ # let(:user_name) { 'Adam' }
#
# # good
- # let('user_name') { 'Adam' }
# subject('user') { create_user }
- class VariableDefinition < Cop
+ # let('user_name') { 'Adam' }
+ class VariableDefinition < Base
include ConfigurableEnforcedStyle
include RuboCop::RSpec::Variable
MSG = 'Use %<style>s for variable names.'
@@ -42,10 +42,10 @@
style == :symbols && string?(variable) ||
style == :strings && symbol?(variable)
end
def string?(node)
- node.str_type? || node.dstr_type?
+ node.str_type?
end
def symbol?(node)
node.sym_type? || node.dsym_type?
end