Skip to content

Commit

Permalink
Allow a reason to be given for the 'it should work' step
Browse files Browse the repository at this point in the history
  • Loading branch information
makmic committed Apr 3, 2019
1 parent 8632ed0 commit 5abb3cc
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ the step definitions.

### development_steps.rb

* **Then it should work**
* **Then it should work...?**

Marks scenario as pending
Marks scenario as pending, optionally explained with a reason.


* **Then console**
Expand Down Expand Up @@ -418,7 +418,7 @@ deprecation notice. Decide for yourself whether you want to use them:
* **Then the "..." field should have no error**


* **Then the "..." checkbox should( not)? be checked**
* **Then the "..." checkbox should( not)? be checked( and disabled)?**


* **Then the radio button "..." should( not)? be (checked|selected)**
Expand Down Expand Up @@ -634,7 +634,7 @@ deprecation notice. Decide for yourself whether you want to use them:
| Beta Group |


* **Then the "..." (field|button) should( not)? be disabled**
* **Then the "..." (field|button|checkbox) should( not)? be disabled**

Tests that an input or button with the given label is disabled.

Expand Down
6 changes: 3 additions & 3 deletions lib/spreewald/development_steps.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# coding: UTF-8

# Marks scenario as pending
Then /^it should work$/ do
pending
# Marks scenario as pending, optionally explained with a reason.
Then /^it should work(.+?)?$/ do |message|
pending(message)
end.overridable

# nodoc
Expand Down
4 changes: 2 additions & 2 deletions tests/rails-4_capybara-3/config/cucumber.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags 'not @wip'"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --no-strict-pending --tags 'not @wip'"
%>
default: <%= std_opts %> features
wip: --tags @wip:3 --wip features
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags 'not @wip'
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --no-strict-pending --tags 'not @wip'
8 changes: 8 additions & 0 deletions tests/shared/features/shared/development_steps.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Feature: Development steps

Scenario: /^it should work(.+?)?$/ (without a reason)
Then it should work

Scenario: /^it should work(.+?)?$/ (with a given reason)
Then it should work once the blocker described here was fulfilled. (Feature should be pending)

0 comments on commit 5abb3cc

Please sign in to comment.