spec/jsonpath_spec.rb in jsonpath-0.3.0 vs spec/jsonpath_spec.rb in jsonpath-0.3.1
- old
+ new
@@ -84,9 +84,13 @@
it "should support eval'd array indicies" do
JsonPath.new('$..book[(@.length-2)]').on(@object).to_a.should == [@object['store']['book'][2]]
end
+ it "should support first" do
+ JsonPath.new('$..book[(@.length-2)]').first(@object) == @object['store']['book'][2]
+ end
+
it "should correct retrieve the right number of all nodes" do
JsonPath.new('$..*').on(@object).to_a.size.should == 29
end
it "should deal with a space in the key name" do