Created
December 21, 2015 02:05
-
-
Save saravanak/d7f1cca7f831bd7a6b5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#http://wiki.yangleo.me/2013/10/29/write-UltiSnips-snippets.html | |
# this snippet creates a step definition out of a feature definiton | |
# only inconvinience is that this one displays the args list as a new line. | |
# not sure how to deal with this anyhow | |
snippet step "create step from feature description" | |
`!p num_replaced = re.sub(r'\d+', '(\d+)', snip.v.text) | |
quote_replaced = re.sub(r'".*"','"([^"]*)"', num_replaced) | |
snip.rv = re.sub(r'^\s*(Then|Given)\s*(.*)',r'\1(/^\2$/) do ', quote_replaced)`|${0:arg1}| | |
end | |
endsnippet | |
snippet text "text_regex" | |
"([^"]*)" | |
endsnippet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment