mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
DEV: Add --exclude-pattern
to bin/turbo_rspec
(#32390)
This commit adds a new `--exclude-pattern` CLI option which supports excluding files using unix style pattern matching. This is to simplify a couple of situations: 1. Running `bin/turbo_rspec plugin/spec` but we want to exclude all tests in the `plugin/spec/system` folder. Example: `bin/turbo_rspec --exclude-pattern="*spec/system*" plugin/spec` 2. Running `bin/turbo_rspec plugin/*/spec/system` but we want to exclude tests for a particular plugin. Example: `bin/turbo_rspec --exclude-pattern="plugins/chat/*" plugin/*/spec/system`
This commit is contained in:

committed by
GitHub

parent
1d7b08f2e1
commit
0252712008
@ -42,14 +42,6 @@ module TurboTests
|
||||
).run
|
||||
end
|
||||
|
||||
def self.default_spec_folders
|
||||
# We do not want to include system specs by default, they are quite slow.
|
||||
Dir
|
||||
.entries("#{Rails.root}/spec")
|
||||
.reject { |entry| !File.directory?("spec/#{entry}") || %w[.. . system].include?(entry) }
|
||||
.map { |entry| "spec/#{entry}" }
|
||||
end
|
||||
|
||||
def initialize(opts)
|
||||
@reporter = opts[:reporter]
|
||||
@files = opts[:files]
|
||||
|
Reference in New Issue
Block a user