jsonpath 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/jsonpath.rb +4 -0
- data/lib/jsonpath/version.rb +1 -1
- data/spec/jsonpath_spec.rb +4 -0
- metadata +3 -3
data/lib/jsonpath.rb
CHANGED
data/lib/jsonpath/version.rb
CHANGED
data/spec/jsonpath_spec.rb
CHANGED
@@ -86,6 +86,10 @@ describe "JsonPath" do
|
|
86
86
|
JsonPath.new('$..book[(@.length-2)]').on(@object).to_a.should == [@object['store']['book'][2]]
|
87
87
|
end
|
88
88
|
|
89
|
+
it "should support first" do
|
90
|
+
JsonPath.new('$..book[(@.length-2)]').first(@object) == @object['store']['book'][2]
|
91
|
+
end
|
92
|
+
|
89
93
|
it "should correct retrieve the right number of all nodes" do
|
90
94
|
JsonPath.new('$..*').on(@object).to_a.size.should == 29
|
91
95
|
end
|
metadata
CHANGED