Skip to content

Commit d9f16fc

Browse files
Fix ci failures
1 parent e2498a3 commit d9f16fc

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

bson.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Gem::Specification.new do |s|
3737
if RUBY_VERSION > '3.2.99'
3838
s.add_dependency 'base64'
3939
s.add_dependency 'bigdecimal'
40+
s.add_dependency 'ostruct'
4041
end
4142

4243
s.test_files = Dir.glob('spec/**/*')

lib/bson/binary.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,9 @@ def self.from_python_legacy_uuid(uuid_binary)
402402

403403
def self.from_vector(vector, dtype, padding = 0)
404404
raise ArgumentError, 'Padding applies only to packed_bit' if padding != 0 && %i[int8 float32].include?(dtype)
405-
raise ArgumentError, 'Padding cannot positive if vector is an empty PACKED_BIT' if padding.positive? && vector.empty?
405+
if padding.positive? && vector.empty?
406+
raise ArgumentError, 'Padding must be zero when the vector is empty for PACKED_BIT'
407+
end
406408

407409
format = case dtype
408410
when :int8

0 commit comments

Comments
 (0)