lib/chutney/linter/too_long_step.rb in chutney-1.6.2 vs lib/chutney/linter/too_long_step.rb in chutney-1.6.3
- old
+ new
@@ -1,17 +1,29 @@
require 'chutney/linter'
+# rubocop:disable Lint/MissingCopEnableDirective
module Chutney
# service class to lint for too long steps
class TooLongStep < Linter
+
+ def initialize
+ @maxlength = 80
+ super
+ end
+
MESSAGE = 'This step is too long at %d characters'.freeze
def lint
steps do |file, feature, scenario, step|
- next if step[:text].length < 80
+ next if step[:text].length <= @maxlength
references = [reference(file, feature, scenario, step)]
add_error(references, MESSAGE % step[:text].length)
end
+ end
+
+ # rubocop:disable Style/TrivialAccessors
+ def maxlength(length)
+ @maxlength = length
end
end
end