Class: RuboCop::Cop::RSpecRails::HttpStatus::NumericStyleChecker

Inherits:
StyleCheckerBase
  • Object
show all
Defined in:
lib/rubocop/cop/rspec_rails/http_status.rb

Overview

:nodoc:

Constant Summary

Constants inherited from StyleCheckerBase

StyleCheckerBase::ALLOWED_STATUSES, StyleCheckerBase::MSG

Instance Attribute Summary

Attributes inherited from StyleCheckerBase

#node

Instance Method Summary collapse

Methods inherited from StyleCheckerBase

#allowed_symbol?, #current, #custom_http_status_code?, #initialize, #message, #offense_range

Constructor Details

This class inherits a constructor from RuboCop::Cop::RSpecRails::HttpStatus::StyleCheckerBase

Instance Method Details

#offensive?Boolean

Returns:

  • (Boolean)


156
157
158
# File 'lib/rubocop/cop/rspec_rails/http_status.rb', line 156

def offensive?
  !node.int_type? && !allowed_symbol?
end

#preferObject



160
161
162
# File 'lib/rubocop/cop/rspec_rails/http_status.rb', line 160

def prefer
  number.to_s
end