Skip to content

Commit 2a8b060

Browse files
authored
Merge pull request suketa#847 from suketa/fix_frozen_string_literal
fix frozen_string_literal warning
2 parents bd97872 + 094905b commit 2a8b060

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/duckdb_test/prepared_statement_test.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'test_helper'
24

35
module DuckDBTest
@@ -485,7 +487,7 @@ def test_bind_blob
485487
stmt.bind_blob(1, DuckDB::Blob.new("\0\1\2\3\4\5"))
486488
assert_instance_of(DuckDB::Result, stmt.execute)
487489
result = con.execute('SELECT col_blob FROM a WHERE id IS NULL')
488-
assert_equal("\0\1\2\3\4\5".force_encoding(Encoding::BINARY), result.first.first)
490+
assert_equal("\0\1\2\3\4\5".encode(Encoding::BINARY), result.first.first)
489491
ensure
490492
con&.query('DELETE FROM a WHERE id IS NULL')
491493
end
@@ -742,12 +744,12 @@ def test_bind_with_blob
742744
stmt.bind(1, DuckDB::Blob.new("\0\1\2\3\4\5"))
743745
assert_instance_of(DuckDB::Result, stmt.execute)
744746
result = con.execute('SELECT col_blob FROM a WHERE id IS NULL')
745-
assert_equal("\0\1\2\3\4\5".force_encoding(Encoding::BINARY), result.first.first)
747+
assert_equal("\0\1\2\3\4\5".encode(Encoding::BINARY), result.first.first)
746748

747-
stmt.bind(1, "\0\1\2\3\4\5".force_encoding(Encoding::BINARY))
749+
stmt.bind(1, "\0\1\2\3\4\5".encode(Encoding::BINARY))
748750
assert_instance_of(DuckDB::Result, stmt.execute)
749751
result = con.execute('SELECT col_blob FROM a WHERE id IS NULL')
750-
assert_equal("\0\1\2\3\4\5".force_encoding(Encoding::BINARY), result.first.first)
752+
assert_equal("\0\1\2\3\4\5".encode(Encoding::BINARY), result.first.first)
751753
ensure
752754
con&.query('DELETE FROM a WHERE id IS NULL')
753755
end

0 commit comments

Comments
 (0)