Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #17 from nearbuy/master

Deserialize BloomFilter::Native properly
  • Loading branch information...
commit a6b02182e367f2805ee995e9dec987451668131d 2 parents 846a687 + 3ccb85f
@igrigorik authored
Showing with 8 additions and 6 deletions.
  1. +2 −2 lib/bloomfilter/native.rb
  2. +6 −4 spec/native_spec.rb
View
4 lib/bloomfilter/native.rb
@@ -70,8 +70,8 @@ def bitmap
def marshal_load(ary)
opts, bitmap = *ary
- @bf = Native.new(opts)
- @bf.bf.load(bitmap) if !bitmap.nil?
+ initialize(opts)
+ @bf.load(bitmap) if !bitmap.nil?
end
def marshal_dump
View
10 spec/native_spec.rb
@@ -133,10 +133,12 @@
bf.insert('bar')
bf.save('bf.out')
- bf = Native.load('bf.out')
- bf.include?('foo').should be_true
- bf.include?('bar').should be_true
- bf.include?('baz').should be_false
+ bf2 = Native.load('bf.out')
+ bf2.include?('foo').should be_true
+ bf2.include?('bar').should be_true
+ bf2.include?('baz').should be_false
+
+ bf.send(:same_parameters?, bf2).should be_true
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.