Comment driven spec builder

https://github.com/maiha/comment-spec.cr

Comment driven spec builder for Crystal:

  • This is a spec string generator.
  • This is not a kind of spec tools.
require "comment-spec"

CommentSpec.parse "1 + 2 # => 3"                   # => "( 1 + 2 ).should eq( 3 )"
CommentSpec.parse "value # => 2016-03-31 12:36:21" # => "( value ).should eq( Time.parse(\"2016-03-31 12:36:21\", \"%F %T\") )"
CommentSpec.parse "v[10] # raises IndexError"      # => "expect_raises(IndexError) { v[10] }"
CommentSpec.parse "value # => #<XXX>"              # => "( value ).class.to_s.should eq( \"XXX\" )"