Skip to content

Commit

Permalink
added disable_tags Feature for disabling tags within feature files. R…
Browse files Browse the repository at this point in the history
…eleased 0.1.0
  • Loading branch information
lindt committed Feb 28, 2016
1 parent 40ec06c commit bea3d37
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions features/disable_tags.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
Feature: Disable Tags
As a Business Analyst
I want to disable checks for specific scenarios
so that I can have exceptions on the exception, not on the whole code base

Background: Prepare Testee
Given a file named "lint.rb" with:
"""
$LOAD_PATH << '../../lib'
require 'gherkin_lint'
linter = GherkinLint::GherkinLint.new
linter.enable %w(InvalidStepFlow)
linter.analyze 'lint.feature'
exit linter.report
"""

Scenario: Broken
Given a file named "lint.feature" with:
"""
Feature: Test
Background: Preparation
Given setup
Scenario: Test
Then check
When action
Given setup
"""
When I run `ruby lint.rb`
Then it should fail with exactly:
"""
InvalidStepFlow - Given after Action or Verification
lint.feature (8): Test.Test step: setup
InvalidStepFlow - Missing Action
lint.feature (6): Test.Test step: check
"""

Scenario: Disable on Scenario Level
Given a file named "lint.feature" with:
"""
Feature: Test
Background: Preparation
Given setup
@disableInvalidStepFlow
Scenario: Test
Then check
When action
Given setup
"""
When I run `ruby lint.rb`
Then it should pass with exactly:
"""
"""

Scenario: Disable on Feature Level
Given a file named "lint.feature" with:
"""
@disableInvalidStepFlow
Feature: Test
Background: Preparation
Given setup
Scenario: Test
Then check
When action
Given setup
"""
When I run `ruby lint.rb`
Then it should pass with exactly:
"""
"""

0 comments on commit bea3d37

Please sign in to comment.