diff --git a/testing/cucumber/features/command_line.feature b/testing/cucumber/features/command_line.feature index 80dd72d..5f0d878 100644 --- a/testing/cucumber/features/command_line.feature +++ b/testing/cucumber/features/command_line.feature @@ -57,14 +57,14 @@ Feature: Using cuke_linter on the command line """ Scenario: Specifying directories and files to lint - Given the following feature file "some.feature": + Given the following feature file "some_feature.feature": """ Feature: Some feature Scenario: A scenario When a step Then a step """ - And the following feature file "a_directory/with_a.feature": + And the following feature file "a_directory/with/some_feature.feature": """ Feature: Some feature Scenario: A scenario @@ -73,14 +73,14 @@ Feature: Using cuke_linter on the command line """ When the following command is executed: """ - cuke_linter -p /some.feature -p /a_directory + cuke_linter -p /some_feature.feature -p /a_directory """ Then the resulting output is the following: """ FeatureWithoutDescriptionLinter Feature has no description - /a_directory/with_a.feature:1 - /some.feature:1 + /a_directory/with/some_feature.feature:1 + /some_feature.feature:1 2 issues found """ @@ -173,8 +173,8 @@ Feature: Using cuke_linter on the command line Given the following feature file "has_no_scenarios.feature": """ - Feature: This feature - has no scenarios + Feature: Has no scenarios + Not a single one """ And the following configuration file "my_config.file": """ diff --git a/testing/rspec/spec/integration/cli_integration_spec.rb b/testing/rspec/spec/integration/cli_integration_spec.rb index f951e80..75de750 100644 --- a/testing/rspec/spec/integration/cli_integration_spec.rb +++ b/testing/rspec/spec/integration/cli_integration_spec.rb @@ -99,7 +99,7 @@ let!(:linted_file) { CukeLinter::FileHelper.create_file(directory: test_directory, name: 'nothing_wrong', extension: '.feature', - text: 'Feature: A name + text: 'Feature: Nothing wrong A description Scenario: A scenario When a step @@ -148,14 +148,14 @@ context 'with path arguments' do let(:file_1) { CukeLinter::FileHelper.create_file(directory: test_directory, - name: 'some', + name: 'some_feature', extension: '.feature', text: 'Feature: Some feature Scenario: A scenario When a step Then a step') } let(:file_2) { CukeLinter::FileHelper.create_file(directory: test_directory, - name: 'a_directory/with_a', + name: 'a_directory/with/some_feature', extension: '.feature', text: 'Feature: Some feature Scenario: A scenario @@ -165,12 +165,13 @@ let(:file_2_directory) { File.dirname(file_2) } let(:command) { "bundle exec ruby #{executable_path} #{flag} #{file_1_path} #{flag} #{file_2_directory}" } + # TODO: add a negative test that makes sure that non-included paths aren't linted when paths are explicitly included it "lints that locations specified by '#{path_flag}'" do expect(results[:std_out]).to eq(['FeatureWithoutDescriptionLinter', ' Feature has no description', - ' /a_directory/with_a.feature:1', - ' /some.feature:1', + ' /a_directory/with/some_feature.feature:1', + ' /some_feature.feature:1', '', '2 issues found', ''].join("\n").gsub('', test_directory)) @@ -209,7 +210,7 @@ let(:flag) { formatter_flag } context 'with formatter arguments' do - let(:linted_file) { CukeLinter::FileHelper.create_file(name: 'some', + let(:linted_file) { CukeLinter::FileHelper.create_file(name: 'some_feature', extension: '.feature', text: 'Feature: Some feature Scenario: A scenario @@ -275,7 +276,7 @@ def format(data) context 'with output arguments' do let(:output_location) { "#{CukeLinter::FileHelper.create_directory}/output.txt" } let(:other_output_location) { "#{CukeLinter::FileHelper.create_directory}/other_output.txt" } - let(:linted_file) { CukeLinter::FileHelper.create_file(name: 'some', + let(:linted_file) { CukeLinter::FileHelper.create_file(name: 'some_feature', extension: '.feature', text: 'Feature: Some feature Scenario: A scenario diff --git a/testing/rspec/spec/integration/cuke_linter_integration_spec.rb b/testing/rspec/spec/integration/cuke_linter_integration_spec.rb index c6c98b4..8595a79 100644 --- a/testing/rspec/spec/integration/cuke_linter_integration_spec.rb +++ b/testing/rspec/spec/integration/cuke_linter_integration_spec.rb @@ -81,6 +81,8 @@ linting_options.delete(:model_trees) end + # TODO: add a negative test that makes sure that non-included paths aren't linted when paths are explicitly included + it 'lints every model in each path' do results = subject.lint(linting_options)