Skip to content

Commit 43a351d

Browse files
yahondaclaude
andcommitted
Fix Ruby warnings in specs
- Wrap splat arguments in parentheses (ambiguous `*`) - Wrap regexp in parentheses for raise_error (ambiguous `/`) - Use .all.each instead of .all with block (block was ignored) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 72a8044 commit 43a351d

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

spec/plsql/procedure_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1966,7 +1966,7 @@ def new_candidate(status)
19661966

19671967
@fields = [:col1, :col2 ]
19681968
@rows = (1..3).map { |i| ["row #{i}", i] }
1969-
plsql.typed_ref_cursor_table.insert_values *@rows
1969+
plsql.typed_ref_cursor_table.insert_values(*@rows)
19701970
plsql.commit
19711971

19721972
end

spec/plsql/schema_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ class TestModel < TestBaseModel
304304
end
305305

306306
it "should log output to specified stream in case of exception" do
307-
expect { plsql.test_dbms_output("test_dbms_output", true) }.to raise_error /Test Error/
307+
expect { plsql.test_dbms_output("test_dbms_output", true) }.to raise_error(/Test Error/)
308308
expect(@buffer.string).to eq("DBMS_OUTPUT: test_dbms_output\n")
309309
end
310310

spec/plsql/table_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@
239239
end
240240

241241
it "should insert many records with array of values" do
242-
plsql.test_employees.insert_values *@employees_all_values
242+
plsql.test_employees.insert_values(*@employees_all_values)
243243
expect(plsql.test_employees.all).to eq(@employees)
244244
end
245245

@@ -332,15 +332,15 @@
332332
plsql.test_employees.update first_name: "Test", where: "employee_id = #{employee_id}"
333333
expect(plsql.test_employees.first(employee_id: employee_id)[:first_name]).to eq("Test")
334334
# all other records should not be changed
335-
plsql.test_employees.all("WHERE employee_id > :1", employee_id) do |employee|
335+
plsql.test_employees.all("WHERE employee_id > :1", employee_id).each do |employee|
336336
expect(employee[:first_name]).not_to eq("Test")
337337
end
338338
end
339339

340340
it "should update all records in table" do
341341
plsql.test_employees.insert @employees
342342
plsql.test_employees.update first_name: "Test"
343-
plsql.test_employees.all do |employee|
343+
plsql.test_employees.all.each do |employee|
344344
expect(employee[:first_name]).to eq("Test")
345345
end
346346
end

spec/plsql/view_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
end
158158

159159
it "should insert many records with array of values" do
160-
plsql.test_employees_v.insert_values *@employees_all_values
160+
plsql.test_employees_v.insert_values(*@employees_all_values)
161161
expect(plsql.test_employees_v.all).to eq(@employees)
162162
end
163163

@@ -230,15 +230,15 @@
230230
plsql.test_employees_v.update first_name: "Test", where: "employee_id = #{employee_id}"
231231
expect(plsql.test_employees_v.first(employee_id: employee_id)[:first_name]).to eq("Test")
232232
# all other records should not be changed
233-
plsql.test_employees_v.all("WHERE employee_id > :1", employee_id) do |employee|
233+
plsql.test_employees_v.all("WHERE employee_id > :1", employee_id).each do |employee|
234234
expect(employee[:first_name]).not_to eq("Test")
235235
end
236236
end
237237

238238
it "should update all records in view" do
239239
plsql.test_employees_v.insert @employees
240240
plsql.test_employees_v.update first_name: "Test"
241-
plsql.test_employees_v.all do |employee|
241+
plsql.test_employees_v.all.each do |employee|
242242
expect(employee[:first_name]).to eq("Test")
243243
end
244244
end

0 commit comments

Comments
 (0)