This repository was archived by the owner on Nov 30, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 756
Add: fuubar To Relish Documentation Under Formatters #2838
Closed
Closed
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
suggested 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. | ||
|
||
 | ||
|
||
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. | |
 | |
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. |
I'm closing this due to inactivity, but if anyone wanted to pick this up on the monorepo in the future it would be welcomed. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 rspec/rspec#61 (comment)
@pirj can you let me know if this is what you had in mind?