Top Level Namespace

Defined Under Namespace

Modules: CucumberApi

Instance Method Summary collapse

Instance Method Details

#resolve(url) ⇒ String

Bind grabbed values into placeholders in given URL Ex: example.com?id=id with => 1 becomes example.com?id=1

Parameters:

  • url (String)

    parameterized URL with placeholders

Returns:

  • (String)

    binded URL or original URL if no placeholders



154
155
156
157
158
159
# File 'lib/cucumber-api/steps.rb', line 154

def resolve url
  unless @grabbed.nil?
    @grabbed.each { |key, value| url = url.gsub /\{#{key}\}/, %/#{value}/ }
  end
  url
end