Sha256: 0469f5fb68aca4c254200e38c029039404ec83b1c3d2ecb022fe9489d9a7be69

Contents?: true

Size: 1013 Bytes

Versions: 10

Compression:

Stored size: 1013 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|
  # 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.'
    fail(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

10 entries across 10 versions & 1 rubygems

Version Path
macros4cuke-0.4.09 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.4.08 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.4.07 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.4.06 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.4.05 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.4.04 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.4.03 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.4.02 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.4.01 examples/i18n/fr/features/step_definitions/use_macro_steps.rb
macros4cuke-0.4.00 examples/i18n/fr/features/step_definitions/use_macro_steps.rb