Sha256: 27887d24fa6b38741a878cfe01e04d1f441402555cb9ab85978b8728da1d0002

Contents?: true

Size: 1.16 KB

Versions: 4

Compression:

Stored size: 1.16 KB

Contents

Feature: Invalid File Name
  As a Business Analyst
  I want to be warned about invalid file name
  so that I name all features consistently

  Background: Prepare Testee
    Given a file named "lint.rb" with:
      """
      $LOAD_PATH << '../../lib'
      require 'gherkin_lint'
      require 'optparse'
      OptionParser.new { |opts| }.parse!

      linter = GherkinLint::GherkinLint.new
      linter.enable %w(InvalidFileName)
      linter.set_linter
      ARGV.each { |file| linter.analyze file }
      exit linter.report

      """

  Scenario Outline: Invalid File Names
    Given a file named "<name>.feature" with:
      """
      Feature: Test
      """
    When I run `ruby lint.rb "<name>.feature"`
    Then it should fail with exactly:
      """
      InvalidFileName - Feature files should be snake_cased
        <name>.feature

      """

    Examples: Invalid Names
      | name    |
      | Lint    |
      | lintMe  |
      | lint me |
      | lint-me |

  Scenario: Valid Example
    Given a file named "lint.feature" with:
      """
      Feature: Test
      """
    When I run `ruby lint.rb lint.feature`
    Then it should pass with exactly:
      """
      """

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gherkin_lint-1.2.2 features/invalid_file_name.feature
gherkin_lint-1.2.1 features/invalid_file_name.feature
gherkin_lint-1.1.0 features/invalid_file_name.feature
gherkin_lint-1.0.0 features/invalid_file_name.feature