Skip to content

Commit

Permalink
! Spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
floere committed May 3, 2014
1 parent c8319c1 commit 14ee495
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions server/spec/functional/terminate_early_spec.rb
Expand Up @@ -126,27 +126,23 @@
try.search('hello', 1, 20).allocations.map(&:count).should == [6, 6, 6, 6]
try.search('hello', 1, 24).allocations.map(&:count).should == [6, 6, 6, 6]

try.search('hello', 1, 0).to_hash.should == {
:allocations => [
result_hash = try.search('hello', 1, 0).to_hash
result_hash[:allocations].should == [
[:terminate_early, 1.792, 6, [[:text1, "hello", "hello"]], [6]],
[:terminate_early, 1.792, 6, [[:text2, "hello", "hello"]], []]
],
:offset => 0,
:duration => anything,
:total => 12
}

try.search('hello', 1, 12).to_hash.should == {
:allocations => [
]
result_hash[:offset].should == 0
result_hash[:total].should == 12

result_hash = try.search('hello', 1, 12).to_hash
result_hash[:allocations].should == [
[:terminate_early, 1.792, 6, [[:text1, "hello", "hello"]], []],
[:terminate_early, 1.792, 6, [[:text2, "hello", "hello"]], []],
[:terminate_early, 1.792, 6, [[:text3, "hello", "hello"]], [6]],
[:terminate_early, 1.792, 6, [[:text4, "hello", "hello"]], []]
],
:offset => 12,
:duration => anything,
:total => 24
}
]
result_hash[:offset].should == 12
result_hash[:total].should == 24

GC.start

Expand Down

0 comments on commit 14ee495

Please sign in to comment.