Skip to content

Commit f0fcace

Browse files
kozy4324marcoroth
authored andcommitted
Suppress rubocop violations
1 parent 27292b7 commit f0fcace

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

test/snapshot_utils.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ def ask?(prompt = "")
1212
Readline.readline("===> #{prompt}? (y/N) ", true).squeeze(" ").strip == "y"
1313
end
1414

15-
module SnapshotUtils
16-
def assert_compiled_snapshot(source, handler: ReActionView::Template::Handlers::ERB, virtual_path: "test", format: :html, locals: [], options: {})
15+
module SnapshotUtils # rubocop:disable Metrics/ModuleLength
16+
def assert_compiled_snapshot(source, handler: ReActionView::Template::Handlers::ERB, virtual_path: "test", format: :html, locals: [], options: {}) # rubocop:disable Metrics/ParameterLists
1717
template = ActionView::Template.new(
1818
source,
1919
"test_template",
@@ -39,7 +39,7 @@ def assert_compiled_snapshot(source, handler: ReActionView::Template::Handlers::
3939
compiled_source
4040
end
4141

42-
def assert_evaluated_snapshot(source, ivars: {}, options: {}, handler: ReActionView::Template::Handlers::ERB, virtual_path: "test", format: :html, locals: [])
42+
def assert_evaluated_snapshot(source, ivars: {}, options: {}, handler: ReActionView::Template::Handlers::ERB, virtual_path: "test", format: :html, locals: []) # rubocop:disable Metrics/ParameterLists,Layout/LineLength
4343
template = ActionView::Template.new(
4444
source,
4545
"test_template",
@@ -66,7 +66,7 @@ def assert_evaluated_snapshot(source, ivars: {}, options: {}, handler: ReActionV
6666
locals: locals,
6767
options: options,
6868
handler: handler,
69-
format: format
69+
format: format,
7070
})
7171

7272
assert_snapshot_matches(result, snapshot_key, mode: "evaluated")
@@ -151,7 +151,7 @@ def assert_snapshot_matches(actual, source, options = {}, mode: nil)
151151
end
152152
end
153153

154-
def snapshot_file(source, options = {})
154+
def snapshot_file(source, options = {}) # rubocop:disable Metrics/MethodLength
155155
test_class_name = underscore(self.class.name)
156156

157157
content_hash = Digest::MD5.hexdigest(source || "#{source.class}-#{source.inspect}")
@@ -161,7 +161,7 @@ def snapshot_file(source, options = {})
161161
mode = options[:mode]
162162
mode_suffix = mode ? "_#{mode}" : ""
163163

164-
opts_for_hash = options.reject { |k, _v| k == :mode }
164+
opts_for_hash = options.except(:mode)
165165

166166
if opts_for_hash && !opts_for_hash.empty?
167167
options_hash = Digest::MD5.hexdigest(opts_for_hash.inspect)

test/template/handlers/herb_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def @view_context.user_path(id)
119119

120120
assert_compiled_snapshot(template)
121121

122-
normalized_result = result.gsub(/>\s+</, '><').gsub(/\s+/, ' ').strip
122+
normalized_result = result.gsub(/>\s+</, "><").gsub(/\s+/, " ").strip
123123
assert_equal '<div class="user-card"><h2>John Doe</h2><span class="badge">Verified</span><a class="btn btn-primary" href="/users/123"> View Profile </a></div>', normalized_result
124124
end
125125

0 commit comments

Comments
 (0)