Skip to content

Commit e013945

Browse files
committed
autofix RSpec/IndexedLet
1 parent 9c3cf30 commit e013945

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

Diff for: .rubocop_todo.yml

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2025-04-04 23:02:51 UTC using RuboCop version 1.75.1.
3+
# on 2025-04-04 23:03:43 UTC using RuboCop version 1.75.1.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 8
10-
# This cop supports safe autocorrection (--autocorrect).
11-
RSpec/MatchArray:
12-
Exclude:
13-
- 'spec/models/book_spec.rb'
14-
- 'spec/models/json_version_spec.rb'
15-
- 'spec/support/shared_examples/queries.rb'
16-
179
# Offense count: 81
1810
# This cop supports safe autocorrection (--autocorrect).
1911
# Configuration parameters: EnforcedStyle.

Diff for: spec/models/book_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
expect((PaperTrail::Version.count - count)).to(eq(2))
2424
expect(
2525
[PaperTrail::Version.order(:id).to_a[-2].item, PaperTrail::Version.last.item]
26-
).to match_array([Person.last, Authorship.last])
26+
).to contain_exactly(Person.last, Authorship.last)
2727
end
2828

2929
it "store version on join destroy" do

Diff for: spec/models/json_version_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
"json_versions"."id" ASC
117117
SQL
118118
)
119-
expect(where_red_apple).to match_array([fruit.versions[1]])
119+
expect(where_red_apple).to contain_exactly(fruit.versions[1])
120120
end
121121
end
122122
end

Diff for: spec/support/shared_examples/queries.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
PaperTrail.config.object_changes_adapter = adapter
3939
expect(
4040
bicycle.versions.where_attribute_changes(:name)
41-
).to match_array([bicycle.versions[0], bicycle.versions[1]])
41+
).to contain_exactly(bicycle.versions[0], bicycle.versions[1])
4242
expect(adapter).to have_received(:where_attribute_changes)
4343
end
4444

@@ -58,7 +58,7 @@
5858
else
5959
expect(
6060
bicycle.versions.where_attribute_changes(:name)
61-
).to match_array([bicycle.versions[0], bicycle.versions[1]])
61+
).to contain_exactly(bicycle.versions[0], bicycle.versions[1])
6262
end
6363
end
6464
end
@@ -246,7 +246,7 @@
246246
PaperTrail.config.object_changes_adapter = adapter
247247
expect(
248248
bicycle.versions.where_object_changes_from(name: "abc")
249-
).to match_array([bicycle.versions[1]])
249+
).to contain_exactly(bicycle.versions[1])
250250
expect(adapter).to have_received(:where_object_changes_from)
251251
end
252252

@@ -266,7 +266,7 @@
266266
else
267267
expect(
268268
bicycle.versions.where_object_changes_from(name: "abc")
269-
).to match_array([bicycle.versions[1]])
269+
).to contain_exactly(bicycle.versions[1])
270270
end
271271
end
272272
end
@@ -329,7 +329,7 @@
329329
PaperTrail.config.object_changes_adapter = adapter
330330
expect(
331331
bicycle.versions.where_object_changes_to(name: "xyz")
332-
).to match_array([bicycle.versions[1]])
332+
).to contain_exactly(bicycle.versions[1])
333333
expect(adapter).to have_received(:where_object_changes_to)
334334
end
335335

@@ -349,7 +349,7 @@
349349
else
350350
expect(
351351
bicycle.versions.where_object_changes_to(name: "xyz")
352-
).to match_array([bicycle.versions[1]])
352+
).to contain_exactly(bicycle.versions[1])
353353
end
354354
end
355355
end

0 commit comments

Comments
 (0)