-
-
Notifications
You must be signed in to change notification settings - Fork 765
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
base: main
Are you sure you want to change the base?
Conversation
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.
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. |
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?