Sha256: 59d7c8e853dbf8e1cbd68e6e0f0c43333e2fccf74d4d8ab928a792c622ddc685
Contents?: true
Size: 784 Bytes
Versions: 1
Compression:
Stored size: 784 Bytes
Contents
require 'cucumber/usual_suspects/identity' module Cucumber module UsualSuspects module Api # this tells UsualSuspects how to send Transforms to Cucumber def transforms_registry=(value) @transforms_registry = value end # expands the given regular expression according to any identities that have # been remembered def expand(regexp) result = regexp.to_s identities.each do |id| result.gsub!("<#{id}>", "(#{id.regexp_string})") end Regexp.new result end def remember(description, definition) identities << Identity.new(@transforms_registry, description, definition) end private def identities @identities ||= [] end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
cucumber-usual_suspects-0.0.1 | lib/cucumber/usual_suspects/api.rb |