comment-spec
comment-spec.cr
Comment driven spec builder for Crystal.
- This is a spec string generator.
- This is not a kind of spec tools.
- crystal: 0.20.3
Installation
Add this to your application's shard.yml
:
dependencies:
comment-spec:
github: maiha/comment-spec.cr
version: 0.1.3
Usage
require "comment-spec"
def gen(line)
CommentSpec.new(line).spec
end
gen "1 + 2 # => 3" # => "( 1 + 2 ).should eq( 3 )"
gen "value # => 2016-03-31 12:36:21" # => "( value ).should eq( Time.parse(\"2016-03-31 12:36:21\", \"%F %T\") )"
gen "v[10] # raises IndexError") # => "expect_raises(IndexError) { v[10] }"
Converting Rules
Development
make spec
Contributing
- Fork it ( https://github.com/maiha/comment-spec.cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- maiha maiha - creator, maintainer