Sha256: a9217cc68b4be162846a399252750544f926e3991597c5e72e887f7b0d28b66c

Contents?: true

Size: 1 KB

Versions: 12

Compression:

Stored size: 1 KB

Contents

# File: demo_steps.rb
# A few step definitions for demo and testing purpose.

When(/^I landed in the homepage$/) do
  trace_steps << 'Invoked step: ... I landed in the homepage'
end

When(/^I click "([^"]*)"$/) do |element|
  trace_steps << "Invoked step: ... I click \"#{element}\""
end


When(/^I fill in "(.*?)" with "(.*?)"$/) do |element, text|
  trace_steps << "Invoked step: ... I fill in \"#{element}\" with \"#{text}\""
end


Then(/^I expect the following step trace:$/) do |step_text|
  trace_steps.should == step_text.split(/\r?\n|\n/)
end


# This step is used for testing a particular exception
When(/^I generate a DataTableNotFound exception$/) do
  wrong = <<-SNIPPET
  When I [fill in the form with]:
  """
    Should be a table instead of triple quote string
  """
SNIPPET
  begin
    steps(wrong)
  rescue Macros4Cuke::DataTableNotFound => exc
    phrase = '[fill in the form with]:'
    msg = "The step with phrase #{phrase} requires a data table."
    exc.message.should == msg
  end
end


# End of file

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
macros4cuke-0.4.08 features/step_definitions/demo_steps.rb
macros4cuke-0.4.07 features/step_definitions/demo_steps.rb
macros4cuke-0.4.06 features/step_definitions/demo_steps.rb
macros4cuke-0.4.05 features/step_definitions/demo_steps.rb
macros4cuke-0.4.04 features/step_definitions/demo_steps.rb
macros4cuke-0.4.03 features/step_definitions/demo_steps.rb
macros4cuke-0.4.02 features/step_definitions/demo_steps.rb
macros4cuke-0.4.01 features/step_definitions/demo_steps.rb
macros4cuke-0.4.00 features/step_definitions/demo_steps.rb
macros4cuke-0.3.42 features/step_definitions/demo_steps.rb
macros4cuke-0.3.41 features/step_definitions/demo_steps.rb
macros4cuke-0.3.40 features/step_definitions/demo_steps.rb