Skip to content

Commit 89f270e

Browse files
committed
style: Fix RuboCop offenses in integration tests
- Add rubocop:disable for Minitest/MultipleAssertions (tests verify multiple data rows) - Add rubocop:disable for Metrics/AbcSize (helper methods build complex table functions) - Add blank lines before assertions (autocorrected) - Fix extra spacing (autocorrected) All 71 files inspected, 0 offenses
1 parent 35952df commit 89f270e

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

test/duckdb_test/table_function_integration_test.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,38 @@ def teardown
1616
end
1717

1818
# Test 1: Simple table function returning data
19+
# rubocop:disable Minitest/MultipleAssertions
1920
def test_simple_table_function
2021
table_function = create_simple_function
2122

2223
@connection.register_table_function(table_function)
2324
result = @connection.query('SELECT * FROM simple_function()')
2425

2526
rows = result.each.to_a
27+
2628
assert_equal 3, rows.count
2729
assert_equal [1, 'Alice'], rows[0]
2830
assert_equal [2, 'Bob'], rows[1]
2931
assert_equal [3, 'Charlie'], rows[2]
3032
end
33+
# rubocop:enable Minitest/MultipleAssertions
3134

3235
# Test 2: Table function with parameters
36+
# rubocop:disable Minitest/MultipleAssertions
3337
def test_table_function_with_parameters
3438
table_function = create_parameterized_function
3539

3640
@connection.register_table_function(table_function)
3741
result = @connection.query("SELECT * FROM repeat_string('hello', 3)")
3842

3943
rows = result.each.to_a
44+
4045
assert_equal 3, rows.count
4146
assert_equal ['test'], rows[0]
4247
assert_equal ['test'], rows[1]
4348
assert_equal ['test'], rows[2]
4449
end
50+
# rubocop:enable Minitest/MultipleAssertions
4551

4652
# Test 3: Connection#register_table_function without block
4753
def test_register_table_function_without_block
@@ -54,9 +60,9 @@ def test_register_table_function_without_block
5460

5561
private
5662

57-
# rubocop:disable Metrics/MethodLength
63+
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
5864
def create_simple_function
59-
done = false # Track state with closure variable
65+
done = false # Track state with closure variable
6066

6167
table_function = DuckDB::TableFunction.new
6268
table_function.name = 'simple_function'
@@ -98,7 +104,7 @@ def create_simple_function
98104
end
99105

100106
def create_parameterized_function
101-
done = false # Track state
107+
done = false # Track state
102108

103109
table_function = DuckDB::TableFunction.new
104110
table_function.name = 'repeat_string'
@@ -130,7 +136,7 @@ def create_parameterized_function
130136

131137
table_function
132138
end
133-
# rubocop:enable Metrics/MethodLength
139+
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
134140

135141
def create_minimal_function
136142
table_function = DuckDB::TableFunction.new

0 commit comments

Comments
 (0)