Skip to content

Instantly share code, notes, and snippets.

@kaichen
Created August 30, 2009 14:52
Show Gist options
  • Save kaichen/177996 to your computer and use it in GitHub Desktop.
Save kaichen/177996 to your computer and use it in GitHub Desktop.
# Crack bug
# Crack use YAML paser to parse json data, and YAML parser cloud not parse colon symbol well.
# brianmario's fork would be better, http://github.com/brianmario/crack
# Fail
should "should be able to parse a JSON includes colon" do
data = %q![{"foo":{"bar":"2009-08-30 : 22:49"}}]!
lambda {
Crack::JSON.parse(data)
}.should_not raise_error(Crack::ParseError)
end
# Pass
should "should be able to parse a JSON includes colon" do
data = %q![{"foo":{"bar":"2009-08-30 : 22:49"}}]!
lambda {
::JSON.parse(data)
}.should_not raise_error
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment