New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(rspec): Add rspec #2113
Open
Zeko369
wants to merge
3
commits into
withfig:master
Choose a base branch
from
Zeko369:feature/rspec-wip-spec
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+245
−0
Open
feat(rspec): Add rspec #2113
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,245 @@ | ||
const completionSpec: Fig.Spec = { | ||
name: "rspec", | ||
description: | ||
"Behaviour Driven Development for Ruby. Making TDD Productive and Fun", | ||
icon: "https://rspec.info/images/logo.png", | ||
args: { | ||
name: "file", | ||
description: "The file to run", | ||
default: "./spec", | ||
isVariadic: true, | ||
generators: { | ||
// TODO: Add custom generator that will suggest line numbers / test scopes | ||
template: ["filepaths", "folders"], | ||
}, | ||
}, | ||
options: [ | ||
{ | ||
name: "-I", | ||
args: { name: "PATH" }, | ||
description: | ||
"Specify PATH to add to $LOAD_PATH (may be used more than once)", | ||
}, | ||
{ | ||
name: ["-r", "--require"], | ||
args: { name: "PATH" }, | ||
description: "Require a file", | ||
}, | ||
{ | ||
name: ["-O", "--options"], | ||
args: { name: "PATH" }, | ||
description: "Specify the path to a custom options file", | ||
}, | ||
{ | ||
name: "order", | ||
description: "Run examples by the specified order type", | ||
args: { | ||
name: "TYPE", | ||
suggestions: [ | ||
{ | ||
name: "defined", | ||
description: | ||
"Examples and groups are run in the order they are defined", | ||
}, | ||
{ | ||
name: "rand", | ||
description: "Randomize the order of groups and examples", | ||
}, | ||
{ name: "random", description: "Alias for rand" }, | ||
{ name: "random:SEED", description: "E.g. --order random:123" }, | ||
{ | ||
name: "recently-modified", | ||
description: "Run the most recently modified files first", | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
name: "--seed", | ||
args: { | ||
name: "SEED", | ||
}, | ||
}, | ||
{ | ||
name: ["--bisect[=verbose]", "--bisect"], | ||
description: | ||
"Repeatedly runs the suite in order to isolate the failures to the smallest reproducible case", | ||
}, | ||
{ | ||
name: "--no-fail-fast", | ||
exclusiveOn: ["--fail-fast"], | ||
}, | ||
{ | ||
name: ["--fail-fast", "--fail-fast=COUNT"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also an argument with |
||
exclusiveOn: ["--no-fail-fast"], | ||
description: "You can add =COUNT, for it to change when to abort", | ||
}, | ||
{ | ||
name: "--failure-exit-code", | ||
args: { name: "CODE" }, | ||
description: "Override the exit code used when there are failing specs", | ||
}, | ||
{ | ||
name: "--error-exit-code", | ||
args: { name: "CODE" }, | ||
description: | ||
"Override the exit code used when there are errors loading or running specs outside of examples", | ||
}, | ||
{ | ||
name: ["-X", "--drb"], | ||
exclusiveOn: ["--no-drb"], | ||
description: "Run examples via DRb", | ||
}, | ||
{ | ||
name: "--no-drb", | ||
exclusiveOn: ["-W"], | ||
description: "Don't run examples via DRb", | ||
}, | ||
{ | ||
name: "--drb-port", | ||
args: { name: "PORT" }, | ||
dependsOn: ["-X"], | ||
description: "Port to connect to the DRb server", | ||
}, | ||
|
||
// ------------------------- Output Options ------------------------- | ||
{ | ||
name: ["-f", "--format"], | ||
description: "Choose a formatter", | ||
args: { | ||
name: "formatter", | ||
default: "progress", | ||
suggestions: [ | ||
{ name: "progress", displayName: "Progress (default - dots)" }, | ||
{ | ||
name: "documentation", | ||
displayName: "Documentation (group and example names)", | ||
}, | ||
{ name: "json", displayName: "JSON" }, | ||
{ | ||
name: "failures", | ||
displayName: | ||
'Failures ("file:line:reason", suitable for editors integration) custom formatter class name', | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
name: ["-o", "--out"], | ||
description: | ||
"Write output to a file instead of $stdout. This option applies to the previously specified --format, or the default format if no format is specified", | ||
args: { | ||
name: "file", | ||
}, | ||
}, | ||
{ | ||
name: "--deprecation-out", | ||
description: "Write deprecation warnings to a file instead of $stderr", | ||
args: { name: "file" }, | ||
}, | ||
{ | ||
name: ["--force-color", "--force-colour"], | ||
description: | ||
"Force the output to be in color, even if the output is not a TTY", | ||
}, | ||
{ | ||
name: ["--no-color", "--no-colour"], | ||
description: | ||
"Force the output to not be in color, even if the output is a TTY", | ||
}, | ||
{ | ||
name: ["-b", "--backtrace"], | ||
description: "Enable full backtrace", | ||
}, | ||
{ | ||
name: "--dry-run", | ||
description: | ||
"Print the formatter output of your suite without running any examples or hooks", | ||
}, | ||
{ | ||
name: ["-w", "--warnings"], | ||
description: "Enable ruby warnings", | ||
}, | ||
{ | ||
name: "--no-profile", | ||
description: "Disable profiling", | ||
exclusiveOn: ["-p"], | ||
}, | ||
{ | ||
name: ["-p", "--profile"], | ||
description: | ||
"Enable profiling of examples and list the slowest examples (default: 10)", | ||
exclusiveOn: ["--no-profile"], | ||
args: { | ||
name: "COUNT", | ||
isOptional: true, | ||
}, | ||
}, | ||
|
||
// ------------------------- Filtering/tags ------------------------- | ||
{ | ||
name: "--only-failures", | ||
description: | ||
"Filter to just the examples that failed the last time they ran", | ||
}, | ||
{ | ||
name: ["-n", "--next-failure"], | ||
description: | ||
"Apply `--only-failures` and abort after one failure. (Equivalent to `--only-failures --fail-fast --order defined`)", | ||
}, | ||
{ | ||
name: ["-P", "--pattern"], | ||
description: 'Load files matching pattern (default: "spec/**/*_spec.rb")', | ||
args: { name: "PATTERN" }, | ||
}, | ||
{ | ||
name: "--exclude-pattern", | ||
description: | ||
"Load files except those matching pattern. Opposite effect of --pattern", | ||
args: { name: "PATTERN" }, | ||
}, | ||
{ | ||
name: ["-e", "--example"], | ||
args: { name: "STRING" }, | ||
description: | ||
"Run examples whose full nested names include STRING (may be used more than once)", | ||
}, | ||
{ | ||
name: ["-E", "--example-matches"], | ||
args: { name: "REGEX" }, | ||
description: | ||
"Run examples whose full nested names match REGEX (may be used more than once)", | ||
}, | ||
{ | ||
name: ["-t", "--tag"], | ||
args: { name: "TAG", description: "TAG[:VALUE]" }, | ||
description: | ||
"Run examples with the specified tag, or exclude examples by adding ~ before the tag", | ||
}, | ||
{ | ||
name: "--default-path", | ||
args: { name: "PATH" }, | ||
description: | ||
"Set the default path where RSpec looks for examples (can be a path to a file or a directory)", | ||
}, | ||
|
||
// ------------------------- Utility ------------------------- | ||
{ | ||
name: "--init", | ||
exclusiveOn: ["--version", "--help"], | ||
description: "Initialize your project with RSpec", | ||
}, | ||
{ | ||
name: ["--version", "-v"], | ||
exclusiveOn: ["--init", "--help"], | ||
description: "Display the version", | ||
}, | ||
{ | ||
name: ["--help", "-h"], | ||
exclusiveOn: ["--init", "--version"], | ||
description: "Show help", | ||
}, | ||
], | ||
}; | ||
|
||
export default completionSpec; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=verbose
should be an argument withrequiresequals