Skip to content

Commit

Permalink
Support also feature files used by RSpec turnip gem. (#919)
Browse files Browse the repository at this point in the history
  • Loading branch information
simi authored Oct 9, 2023
1 parent 273a1cc commit 439a9ca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

### Added

- Support for RSpec turnip feature files.

## 4.2.2 - 2023-09-05

### Breaking Changes
Expand Down
4 changes: 3 additions & 1 deletion lib/parallel_tests/rspec/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ def test_file_name
"spec"
end

# used to find all _spec.rb files
# supports also feature files used by rspec turnip extension
def test_suffix
/_spec\.rb$/
/(_spec\.rb|\.feature)$/
end

def line_is_result?(line)
Expand Down
6 changes: 6 additions & 0 deletions spec/parallel_tests/rspec/runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ def call(*args)
ParallelTests::RSpec::Runner.send(:find_tests, *args)
end

it "finds turnip feature files" do
with_files(['a/test.feature']) do |root|
expect(call(["#{root}/"])).to eq(["#{root}/a/test.feature"])
end
end

it "doesn't find backup files with the same name as test files" do
with_files(['a/x_spec.rb', 'a/x_spec.rb.bak']) do |root|
expect(call(["#{root}/"])).to eq(["#{root}/a/x_spec.rb"])
Expand Down

0 comments on commit 439a9ca

Please sign in to comment.