Sha256: 1f392ba74468a9ba6a6e770be0086292848e3e3af48ced14efb9c305a1437fa0

Contents?: true

Size: 1.02 KB

Versions: 8

Compression:

Stored size: 1.02 KB

Contents

# encoding: utf-8
# Définitions de pas de scénarios utilisant Macros4Cuke.


Etantdonné(/^que je crée le pas "(?:Soit|Quand|Alors) j(?:e |')\[((?:[^\\\]]|\\.)+)\](:?)" qui équivaut à:$/) do |macro_phrase, colon_capture, template|
  use_table = (colon_capture == ':')
  add_macro(macro_phrase, template, use_table)
end


Quand(/^j(?:e |')\[((?:[^\\\]]|\\.)+)\]$/) do |macro_phrase|
  # This will call the macro with the given phrase
  invoke_macro(macro_phrase)
end


Quand(/^j(?:e |')\[([^\]]+)\]:$/) do |macro_phrase, table_argument|
  # Ensure that the second argument is of the correct type
  unless table_argument.kind_of?(Cucumber::Ast::Table)
    error_message = "This step must have a data table as an argument."
    raise Macros4Cuke::DataTableNotFound, error_message
  end

  # This will call the macro with the given phrase.
  # The second argument consists of an array with couples
  # of the kind: [argument name, actual value]
  invoke_macro(macro_phrase, table_argument.raw)
end

# End of file

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
macros4cuke-0.3.20 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.3.19 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.3.18 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.3.17 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.3.16 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.3.15 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.3.14 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.3.13 examples/i18n/fr/features/step_definitions/use_macro_steps.rb