Skip to content

Commit 7acaa13

Browse files
committed
style(rubocop): Minitest unsafe autocorrections
1 parent bab0c09 commit 7acaa13

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

test/test_database.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def test_block_closes_self
253253
thing = nil
254254
SQLite3::Database.new(":memory:") do |db|
255255
thing = db
256-
assert !thing.closed?
256+
refute_predicate thing, :closed?
257257
end
258258
assert_predicate thing, :closed?
259259
end
@@ -262,7 +262,7 @@ def test_open_with_block_closes_self
262262
thing = nil
263263
SQLite3::Database.open(":memory:") do |db|
264264
thing = db
265-
assert !thing.closed?
265+
refute_predicate thing, :closed?
266266
end
267267
assert_predicate thing, :closed?
268268
end

test/test_database_flags.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def test_open_database_readonly_flags
5050

5151
def test_open_database_readwrite_flags
5252
@db = SQLite3::Database.new("test-flags.db", flags: SQLite3::Constants::Open::READWRITE)
53-
assert !@db.readonly?
53+
refute_predicate @db, :readonly?
5454
end
5555

5656
def test_open_database_readonly_flags_cant_open

test/test_database_readwrite.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def teardown
1616

1717
def test_open_readwrite_database
1818
@db = SQLite3::Database.new("test-readwrite.db", readwrite: true)
19-
assert !@db.readonly?
19+
refute_predicate @db, :readonly?
2020
end
2121

2222
def test_open_readwrite_readonly_database

test/test_integration.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_table_info_without_defaults_for_version_3_3_8_and_higher
4444
end
4545

4646
def test_complete_fail
47-
assert !@db.complete?("select * from foo")
47+
refute @db.complete?("select * from foo")
4848
end
4949

5050
def test_complete_success
@@ -144,7 +144,7 @@ def test_execute_with_block_no_bind_no_match
144144
@db.execute("select * from foo where a > 100") do |row|
145145
called = true
146146
end
147-
assert !called
147+
refute called
148148
end
149149

150150
def test_execute_no_block_with_bind_no_match
@@ -157,7 +157,7 @@ def test_execute_with_block_with_bind_no_match
157157
@db.execute("select * from foo where a > ?", 100) do |row|
158158
called = true
159159
end
160-
assert !called
160+
refute called
161161
end
162162

163163
def test_execute_no_block_no_bind_with_match
@@ -462,22 +462,22 @@ def test_transaction_commit_in_block
462462
end
463463

464464
def test_transaction_active
465-
assert !@db.transaction_active?
465+
refute_predicate @db, :transaction_active?
466466
@db.transaction
467467
assert_predicate @db, :transaction_active?
468468
@db.commit
469-
assert !@db.transaction_active?
469+
refute_predicate @db, :transaction_active?
470470
end
471471

472472
def test_transaction_implicit_rollback
473-
assert !@db.transaction_active?
473+
refute_predicate @db, :transaction_active?
474474
@db.transaction
475475
@db.execute("create table bar (x CHECK(1 = 0))")
476476
assert_predicate @db, :transaction_active?
477477
assert_raises(SQLite3::ConstraintException) do
478478
@db.execute("insert or rollback into bar (x) VALUES ('x')")
479479
end
480-
assert !@db.transaction_active?
480+
refute_predicate @db, :transaction_active?
481481
end
482482

483483
def test_interrupt

test/test_integration_resultset.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_reset_with_bind
3737

3838
def test_eof_inner
3939
@result.reset(1)
40-
assert !@result.eof?
40+
refute_predicate @result, :eof?
4141
end
4242

4343
def test_eof_edge
@@ -128,7 +128,7 @@ def test_columns
128128
def test_close
129129
stmt = @db.prepare("select * from foo")
130130
result = stmt.execute
131-
assert !result.closed?
131+
refute_predicate result, :closed?
132132
result.close
133133
assert_predicate result, :closed?
134134
assert_predicate stmt, :closed?

test/test_integration_statement.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def test_types_computed
166166

167167
def test_close
168168
stmt = @db.prepare("select * from foo")
169-
assert !stmt.closed?
169+
refute_predicate stmt, :closed?
170170
stmt.close
171171
assert_predicate stmt, :closed?
172172
assert_raise(SQLite3::Exception) { stmt.execute }

test/test_statement.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,12 @@ def test_step
221221

222222
def test_step_twice
223223
assert_not_nil @stmt.step
224-
assert !@stmt.done?
224+
refute_predicate @stmt, :done?
225225
assert_nil @stmt.step
226226
assert_predicate @stmt, :done?
227227

228228
@stmt.reset!
229-
assert !@stmt.done?
229+
refute_predicate @stmt, :done?
230230
end
231231

232232
def test_step_never_moves_past_done

0 commit comments

Comments
 (0)