Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/english/rspec-repetitive
Repeat RSpec examples with custom setup.
https://github.com/english/rspec-repetitive
rspec ruby testing
Last synced: 14 days ago
JSON representation
Repeat RSpec examples with custom setup.
- Host: GitHub
- URL: https://github.com/english/rspec-repetitive
- Owner: english
- License: mit
- Created: 2019-03-08T00:28:52.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-08T00:53:06.000Z (almost 6 years ago)
- Last Synced: 2025-01-11T13:53:54.746Z (18 days ago)
- Topics: rspec, ruby, testing
- Language: Ruby
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# RSpec::Repetitive
Repeat RSpec examples with custom setup.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'rspec-repetitive'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install rspec-repetitive
## Usage
The following RSpec example would run twice: first without then with a feature switch enabled.
```rb
require 'rspec'
require 'rspec-repetitive'RSpec.configure do |config|
RSpec::Repetitive.configure(config)
endRSpec.describe "something that should work with and without a feature switch enabled" do
repeat_each_example "with my_feature enabled" do
FeatureSwitch.enable(:my_feature)
endit "works" do
# ...
end
end
```Running the above example would produce the following:
```
$ rspec my_spec.rbsomething that should work with and without a feature switch enabled
works
with my_feature enabled worksFinished in 0.00153 seconds (files took 0.12087 seconds to load)
2 examples, 0 failures
```## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).