Skip to content

Commit

Permalink
Count files under spec/ as test files
Browse files Browse the repository at this point in the history
  • Loading branch information
KaanOzkan committed Feb 28, 2024
1 parent 0fcefad commit 5dfe485
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/Files.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ PackagedLevel File::filePackagedSigil(string_view source) {
}

bool isTestPath(string_view path) {
return absl::EndsWith(path, ".test.rb") || absl::StrContains(path, "/test/");
return absl::EndsWith(path, ".test.rb") || absl::StrContains(path, "/test/") || absl::StrContains(path, "/spec/");
}

bool isPackageRBIPath(string_view path) {
Expand Down
2 changes: 1 addition & 1 deletion core/Files.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class File final {
bool cached : 1;
// some reasonable invariants don't hold for invalid files
bool hasParseErrors : 1;
// only relevant in --stripe-packages mode: is the file a `.test.rb` file?
// is the file a `.test.rb` file or under the folders `test/` or `spec/`?
bool isPackagedTest : 1;
// if true, the file is an rbi generated by --package-gen-output
bool isPackageRBI : 1;
Expand Down
2 changes: 1 addition & 1 deletion website/docs/highlight-untyped.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ There are multiple ways to enable untyped code highlights.

- Everywhere but tests

Sorbet treats any file in a folder named `test` or ending with the
Sorbet treats any file in a folder named `test` or `spec` or ending with the
`.test.rb` suffix as a test file. This is not yet configurable.

The new setting will be logged in the "Sorbet" output window.
Expand Down

0 comments on commit 5dfe485

Please sign in to comment.