Skip to content

Commit 990da4b

Browse files
authored
Replace features task with spec task (#568)
* Replace features task with spec task - Rewrote all cucumber features as minitest/spec specs - Added spec task, and removed features task - Updated CI scripts to run spec instead of features - Stopped bundling Cucumber * Fix issues identified by GitHub copilot review - In CI, rename Features jobs to Spec - Configure Aruba timeout to 30 seconds, as had been the case in the features. - Fix creation of empty.rb in minimum_score_spec.rb, and then fix the spec to not false-negative on the correctly generated higher score. * Catch up with rubocop cop updates - Exclude Style/OneClassPerFile in offending files. - When building ast_node_children in lib/rubycritic/analysers/helpers/ast_node.rb, use grep instead of select with a kind check (Style/SelectByKind) - When generating hash in RubyCritic::AnalysisSummary, use to_h directly (Style/ReduceToHash)
1 parent 0bd2f52 commit 990da4b

18 files changed

Lines changed: 311 additions & 314 deletions

File tree

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
paths_ignore: '["**/README.md", "**/docs/**", "**/CHANGELOG.md"]'
2121
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
2222

23-
Features:
23+
Specs:
2424
needs: pre_job # skip duplicates
2525
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
2626
runs-on: ubuntu-latest
@@ -47,8 +47,8 @@ jobs:
4747
bundler-cache: true
4848
cache-version: 1
4949
continue-on-error: ${{ matrix.experimental }}
50-
- name: Run Cucumber
51-
run: bundle exec cucumber features --format progress --color
50+
- name: Run feature specs
51+
run: bundle exec rake spec
5252
continue-on-error: ${{ matrix.experimental }}
5353

5454
Rubocop:

.rubocop.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ Gemspec/DevelopmentDependencies:
1717
Exclude:
1818
- 'rubycritic.gemspec'
1919

20-
Layout/BlockAlignment:
21-
Enabled: false
22-
Exclude:
23-
- 'features/step_definitions/rake_task_steps.rb'
24-
2520
Layout/LineLength:
2621
Max: 120
2722

@@ -58,6 +53,7 @@ Metrics/BlockLength:
5853
Metrics/MethodLength:
5954
Exclude:
6055
- 'lib/rubycritic/configuration.rb'
56+
- 'test/integration/integration_test_helper.rb'
6157

6258
Naming/RescuedExceptionsVariableName:
6359
Exclude:
@@ -76,6 +72,13 @@ Style/Documentation:
7672
Style/HashSyntax:
7773
EnforcedShorthandSyntax: either
7874

75+
Style/OneClassPerFile:
76+
Exclude:
77+
- 'lib/rubycritic/analysers/helpers/ast_node.rb'
78+
- 'test/analysers_test_helper.rb'
79+
- 'test/fakefs_helper.rb'
80+
- 'test/test_helper.rb'
81+
7982
Style/OpenStructUse:
8083
Exclude:
8184
- 'test/lib/rubycritic/generators/turbulence_test.rb'

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* [CHORE] ...
66
* [FEATURE] ...
77

8+
* [CHANGE] Replace all Cucumber features with Minitest/Spec specs (by [@faisal][])
9+
810
# v5.0.0 / 2026-01-26 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.12.0...v5.0.0)
911

1012
* [CHORE] Bump byebug dependency (by [@faisal][])

Rakefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
require 'bundler/gem_tasks'
44
require 'rake/testtask'
55
require 'rubocop/rake_task'
6-
require 'cucumber/rake/task'
76
require 'reek/rake/task'
87
require 'rubycritic/rake_task'
98

@@ -13,8 +12,10 @@ Rake::TestTask.new do |task|
1312
task.pattern = 'test/**/*_test.rb'
1413
end
1514

16-
Cucumber::Rake::Task.new(:features) do |t|
17-
t.cucumber_opts = %w[features --format progress --color]
15+
Rake::TestTask.new(:spec) do |task|
16+
task.libs.push 'lib'
17+
task.libs.push 'test'
18+
task.pattern = 'test/**/*_spec.rb'
1819
end
1920

2021
RuboCop::RakeTask.new
@@ -25,4 +26,4 @@ RubyCritic::RakeTask.new do |task|
2526
task.paths = FileList['lib/**/*.rb']
2627
end
2728

28-
task default: %i[test features reek rubocop]
29+
task default: %i[test spec reek rubocop]

features/command_line_interface/minimum_score.feature

Lines changed: 0 additions & 39 deletions
This file was deleted.

features/command_line_interface/options.feature

Lines changed: 0 additions & 54 deletions
This file was deleted.

features/rake_task.feature

Lines changed: 0 additions & 82 deletions
This file was deleted.

features/step_definitions/rake_task_steps.rb

Lines changed: 0 additions & 5 deletions
This file was deleted.

features/step_definitions/rubycritic_steps.rb

Lines changed: 0 additions & 33 deletions
This file was deleted.

features/step_definitions/sample_file_steps.rb

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)