-
-
Notifications
You must be signed in to change notification settings - Fork 763
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
16 changed files
with
256 additions
and
111 deletions.
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
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,6 @@ | |||
The `rspec` command comes with several options you can use to customize RSpec's | |||
behavior, including output formats, filtering examples, etc. | |||
|
|||
For a full list of options, run the `rspec` command with the `--help` flag: | |||
|
|||
$ rspec --help |
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
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
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,73 @@ | |||
Feature: --formatt option | |||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
|||
|
|||
Use the --format option to tell RSpec how to format the output. | |||
|
|||
RSpec ships with a few formatters built in. By default, it uses the progress | |||
formatter, which generates output like this: | |||
|
|||
....F.....*..... | |||
|
|||
A '.' represents a passing example, 'F' is failing, and '*' is pending. | |||
|
|||
To see the documentation strings passed to each describe(), context(), and it() | |||
method, use the documentation formatter: | |||
|
|||
$ rspec spec --format documentation | |||
|
|||
You can also specify an output target (STDOUT by default) by appending a | |||
filename to the argument: | |||
|
|||
$ rspec spec --format documentation:rspec.output.txt | |||
|
|||
Background: | |||
Given a file named "example_spec.rb" with: | |||
""" | |||
describe "something" do | |||
it "does something that passes" do | |||
5.should eq(5) | |||
end | |||
it "does something that fails" do | |||
5.should eq(4) | |||
end | |||
it "does something that is pending", :pending => true do | |||
5.should be > 3 | |||
end | |||
end | |||
""" | |||
|
|||
Scenario: progress bar format (default) | |||
When I run "rspec example_spec.rb" | |||
Then the output should contain ".F*" | |||
|
|||
Scenario: documentation format | |||
When I run "rspec example_spec.rb --format documentation" | |||
Then the output should contain: | |||
""" | |||
something | |||
does something that passes | |||
does something that fails (FAILED - 1) | |||
does something that is pending (PENDING: Not Yet Implemented) | |||
""" | |||
|
|||
Scenario: documentation format saved to a file | |||
When I run "rspec example_spec.rb --format documentation --out rspec.txt" | |||
Then the file "rspec.txt" should contain: | |||
""" | |||
something | |||
does something that passes | |||
does something that fails (FAILED - 1) | |||
does something that is pending (PENDING: Not Yet Implemented) | |||
""" | |||
|
|||
Scenario: multiple formats | |||
When I run "rspec example_spec.rb --format progress --format documentation --out rspec.txt" | |||
Then the output should contain ".F*" | |||
And the file "rspec.txt" should contain: | |||
""" | |||
something | |||
does something that passes | |||
does something that fails (FAILED - 1) | |||
does something that is pending (PENDING: Not Yet Implemented) | |||
""" |
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
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
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
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
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
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
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
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
Oops, something went wrong.
Minor typo in here.