New ParameterTypes for Doc Strings

22 views
Skip to first unread message

alexey.vo...@gmail.com

unread,
Nov 19, 2017, 10:06:53 AM11/19/17
to Cukes
Hi guys,

Is there any way to use new ParameterTypes with doc strings to make some transformations to string. Small example:
    Then I have output:
    """
    gem version is <gem_version>
    """
And I want use ParameterType to replace <gem_version> with actual version of the gem. I've tried this:

ParameterType(
    name: 'test',
    regexp: /<gem_version>/,
    transformer: ->(version) { version.gsub('<gem_version>', MyGem::VERSION) }
    end
)

It didn't work. Before update it worked with Transformation like this:


Transform /<gem_version>/ do |text|
   text.gsub('<gem_version>', MyGem::VERSION)
 end 
 

Best regards,
Alexey
Reply all
Reply to author
Forward
0 new messages