Permalink
Browse files

Merge pull request #17 from nearbuy/master

Deserialize BloomFilter::Native properly
  • Loading branch information...
2 parents 846a687 + 3ccb85f commit a6b02182e367f2805ee995e9dec987451668131d @igrigorik committed May 9, 2012
Showing with 8 additions and 6 deletions.
  1. +2 −2 lib/bloomfilter/native.rb
  2. +6 −4 spec/native_spec.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
@@ -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

0 comments on commit a6b0218

Please sign in to comment.