aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/practical/json_spec.cr10
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/practical/json_spec.cr b/spec/practical/json_spec.cr
index 7a2875f..79d60dd 100644
--- a/spec/practical/json_spec.cr
+++ b/spec/practical/json_spec.cr
@@ -2,8 +2,6 @@ require "../spec_helper"
include Parcom
-# NOTE: WORK IN PROGRESS
-
alias JSONType = Nil \
| Bool \
| Int64 \
@@ -412,6 +410,14 @@ describe "example: JSON parsing" do
result.tokens.empty?.should be_true
end
end
+
+ it "parses objects" do
+ {"{}", "{\"foo\": 1}"}.each do |s|
+ result = json_value.parse(Tokens.from_string(s))
+ result.value.data.should be_a(Hash(String, JSONValue))
+ result.tokens.empty?.should be_true
+ end
+ end
end
end