-
-
Notifications
You must be signed in to change notification settings - Fork 763
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
Add: fuubar To Relish Documentation Under Formatters #2838
Open
jfelchner
wants to merge
1
commit into
rspec:main
Choose a base branch
from
jfelchner:add-fuubar-to-formatters-section
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
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.
Conversation
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
JonRowe
requested changes
Dec 31, 2020
Comment on lines
+1
to
+55
Feature: fuubar | ||
|
||
[fuubar](https://github.com/thekompanee/fuubar) is an instafailing formatter | ||
that uses a progress bar instead of a string of letters and dots as feedback. | ||
|
||
It provides visual feedback of how many specs are left to be run as well as | ||
a rough approximation of how long it will take. | ||
|
||
![demo](https://kompanee-public-assets.s3.amazonaws.com/readmes/fuubar-examples.gif) | ||
|
||
Installation | ||
-------------------------------------------------------------------------------- | ||
|
||
```ruby | ||
gem install fuubar | ||
|
||
# or in your Gemfile | ||
|
||
gem 'fuubar' | ||
``` | ||
|
||
Usage | ||
-------------------------------------------------------------------------------- | ||
|
||
In order to use fuubar, you have three options. | ||
|
||
### Option 1: Invoke It Manually Via The Command Line | ||
|
||
```bash | ||
rspec --format Fuubar --color | ||
``` | ||
|
||
### Option 2: Add It To Your Local `.rspec` File | ||
|
||
```text | ||
# .rspec | ||
|
||
--format Fuubar | ||
--color | ||
``` | ||
|
||
### Option 3: Add It To Your `spec_helper.rb` | ||
|
||
```ruby | ||
# spec/spec_helper.rb | ||
|
||
RSpec.configure do |config| | ||
config.add_formatter 'Fuubar' | ||
end | ||
``` | ||
|
||
--- | ||
|
||
For more information, you can [view the fuubar | ||
README](https://github.com/thekompanee/fuubar) |
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.
I would write this as a scenario (or scenarios) demonstrating 3rd party formatters.
Suggested change
Feature: fuubar | |
[fuubar](https://github.com/thekompanee/fuubar) is an instafailing formatter | |
that uses a progress bar instead of a string of letters and dots as feedback. | |
It provides visual feedback of how many specs are left to be run as well as | |
a rough approximation of how long it will take. | |
![demo](https://kompanee-public-assets.s3.amazonaws.com/readmes/fuubar-examples.gif) | |
Installation | |
-------------------------------------------------------------------------------- | |
```ruby | |
gem install fuubar | |
# or in your Gemfile | |
gem 'fuubar' | |
``` | |
Usage | |
-------------------------------------------------------------------------------- | |
In order to use fuubar, you have three options. | |
### Option 1: Invoke It Manually Via The Command Line | |
```bash | |
rspec --format Fuubar --color | |
``` | |
### Option 2: Add It To Your Local `.rspec` File | |
```text | |
# .rspec | |
--format Fuubar | |
--color | |
``` | |
### Option 3: Add It To Your `spec_helper.rb` | |
```ruby | |
# spec/spec_helper.rb | |
RSpec.configure do |config| | |
config.add_formatter 'Fuubar' | |
end | |
``` | |
--- | |
For more information, you can [view the fuubar | |
README](https://github.com/thekompanee/fuubar) | |
Feature: Configuring 3rd party formatters | |
RSpec supports a variety of 3rd party formatters thanks to our awesome community. | |
One such example is [`fuubar`](https://github.com/thekompanee/fuubar) a fast failing formatter which approximates your test suite as a progress bar rather than continuous output, providing visual feedback of how many specs are left to run. | |
Scenario: Invoking a 3rd party formatter manually from the command line. | |
Given the "fuubar" gem is installed | |
Given a file named "spec/example_spec.rb" with: | |
"""ruby | |
RSpec.describe "examples" do | |
it "is an example" do | |
end | |
it "is another example" do | |
end | |
end | |
""" | |
When I run `rspec --format Fuubar spec/example_spec.rb` | |
Then the output should contain "<fuubar output>" | |
Scenario: Invoking a 3rd party formatter via a .rspec file | |
Given the "fuubar" gem is installed | |
Given a file named ".rspec" with: | |
""" | |
--format Fuubar | |
""" | |
And a file named "spec/example_spec.rb" with: | |
"""ruby | |
RSpec.describe "examples" do | |
it "is an example" do | |
end | |
it "is another example" do | |
end | |
end | |
""" | |
When I run `rspec spec/example_spec.rb` | |
Then the output should contain "<fuubar output>" | |
Scenario: Invoking a 3rd party formatter via your spec_helper.rb | |
Given the "fuubar" gem is installed | |
Given a file named "spec/spec_helper.rb" with: | |
"""ruby | |
RSpec.configure do |config| | |
config.add_formatter 'Fuubar' | |
end | |
""" | |
And a file named "spec/example_spec.rb" with: | |
"""ruby | |
RSpec.describe "examples" do | |
it "is an example" do | |
end | |
it "is another example" do | |
end | |
end | |
""" | |
When I run `rspec spec/example_spec.rb` | |
Then the output should contain "<fuubar output>" |
@jfelchner This build fails since it's not just a text file, it's a runnable scenario. |
Thanks @pirj I'll have to work on this when I get a few minutes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As discussed in https://github.com/rspec/rspec/issues/61#issuecomment-751519097
@pirj can you let me know if this is what you had in mind?