Sha256: cb4252f8050436f1ef30fd663c1d8b77d82c6f374c1b814cd24041ece39e3abd

Contents?: true

Size: 1001 Bytes

Versions: 14

Compression:

Stored size: 1001 Bytes

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|
  invoke_macro(macro_phrase)  # This will call the macro with the given 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)
     raise Macros4Cuke::DataTableNotFound, "This step must have a data table as an argument."
  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

14 entries across 14 versions & 1 rubygems

Version Path
macros4cuke-0.3.12 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.3.11 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.3.10 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.3.09 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.3.08 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.3.07 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.3.06 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.3.03 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.3.02 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.3.01 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.3.00 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.2.22 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.2.21 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.2.20 examples/i18n/fr/features/step_definitions/use_macro_steps.rb