Created
July 28, 2010 00:38
-
-
Save mzsanford/493119 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'flockdb' | |
flock = Flock.new "localhost:7915", :graphs => { :a_to_b => 1, :b_to_c => 2 } | |
flock.add(1, :a_to_b, 1) | |
flock.add(1, :a_to_b, 2) | |
flock.add(1, :a_to_b, 3) | |
flock.add(2, :b_to_c, 1) | |
flock.add(2, :b_to_c, 2) | |
# OK | |
flock.select(1, :a_to_b, nil).size == flock.select(1, :a_to_b, nil).to_a.size | |
# Not OK, .size is 0 but to_a.size is 1 | |
flock.select(1, :a_to_b, nil).intersect(nil, :b_to_c, 2).size == flock.select(1, :a_to_b, nil).intersect(nil, :b_to_c, 2).to_a.size |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment