/usr/share/doc/ruby-rspec-retry/README.md is in ruby-rspec-retry 0.2.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | # RSpec::Retry
RSpec::Retry adds ``:retry`` option to rspec example.
It is for randomly failing example.
If example has ``:retry``, rspec retry specified times until success.
## Installation
Add this line to your application's Gemfile:
gem 'rspec-retry'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rspec-retry
require in ``spec_helper.rb``
```ruby
# spec/spec_helper.rb
require 'rspec/retry'
RSpec.configure do |config|
config.verbose_retry = true # show retry status in spec process
end
```
## Usage
```ruby
it 'should randomly success', :retry => 3 do
rand(2).should == 1
end
# run spec (following log is shown if verbose_retry options is true)
# RSpec::Retry: 2nd try ./spec/lib/random_spec.rb:49
# RSpec::Retry: 3rd try ./spec/lib/random_spec.rb:49
```
## Configuration
- __:verbose_retry__(default: *false*) Print retry status
- __:default_retry_count__(default: *1*) If retry count is not set in example, this value is used by default
- __:clear_lets_on_failure__(default: *true*) Clear memoized value for ``let`` before retrying
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
|