Permalink
Browse files

fix a spec for newer versions of mongo's explain

  • Loading branch information...
1 parent 81257b0 commit 6f89019c5a36cc8d571cd3c2bb7f73c133d6e207 @smtlaissezfaire smtlaissezfaire committed Dec 11, 2016
Showing with 8 additions and 2 deletions.
  1. +8 −2 spec/plucky/query_spec.rb
View
@@ -815,8 +815,14 @@
it "works" do
explain = subject.where(:age.lt => 28).explain
- explain['cursor'].should == 'BasicCursor'
- explain['nscanned'].should == 3
+
+ if explain['cursor']
+ explain['cursor'].should == 'BasicCursor'
+ explain['nscanned'].should == 3
+ elsif explain['executionStats']
+ explain['executionStats']['executionSuccess'].should == true
+ explain['executionStats']['totalDocsExamined'].should == 3
+ end
end
end

0 comments on commit 6f89019

Please sign in to comment.