Sha256: d411171797f56926695f32a39806b1ebad622c138f778677d6ac9604eb7beaf5

Contents?: true

Size: 907 Bytes

Versions: 2

Compression:

Stored size: 907 Bytes

Contents

When /^I get help for "([^"]*)"$/ do |app_name|
  @app_name = app_name
  When %(I run `#{app_name} --help`)
end

Then /^the following options should be documented:$/ do |options|
  options.raw.each do |option|
    Then %(the option "#{option[0]}" should be documented)
  end
end

Then /^the option "([^"]*)" should be documented$/ do |option|
  Then %(the output should match /^\\s*#{option}\\s+\\w\\w\\w+/)
end

Then /^the banner should be present$/ do
  Then %(the output should match /Usage: #{@app_name}/)
end

Then /^the banner should document that this app takes options$/ do
  Then %(the output should match /\[options\]/)
end

Then /^the banner should document that this app's arguments are:$/ do |table|
  expected_arguments = table.raw.map { |row|
    option = row[0]
    option = "[#{option}]" if row[1] == 'optional'
  }.join(' ')
  Then %(the output should contain "#{expected_arguments}")
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
methadone-0.0.2 lib/methadone/cucumber.rb
methadone-0.0.1 lib/methadone/cucumber.rb