Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/th1agoalmeida/bdd
Given/When/Then/And/But output to RSpec and Minitest
https://github.com/th1agoalmeida/bdd
bdd minitest rspec ruby tests user-stories
Last synced: 3 months ago
JSON representation
Given/When/Then/And/But output to RSpec and Minitest
- Host: GitHub
- URL: https://github.com/th1agoalmeida/bdd
- Owner: th1agoalmeida
- License: mit
- Created: 2015-05-18T00:46:23.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-09-09T19:35:49.000Z (over 4 years ago)
- Last Synced: 2024-09-14T13:24:09.991Z (3 months ago)
- Topics: bdd, minitest, rspec, ruby, tests, user-stories
- Language: Ruby
- Homepage:
- Size: 243 KB
- Stars: 35
- Watchers: 8
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Bdd
Bdd is a **User Story Framework**. Add Acceptance Criteria documentation directly on your Ruby Tests.
## Status
| Is It Working? | Is It Tested? | Code Quality | **# of Downloads** | **Get Involved!** |
|:---|:---|:---|:---|:---|
| [![Master Build Status](https://api.travis-ci.org/thejamespinto/bdd.svg?branch=master)](https://travis-ci.org/thejamespinto/bdd) | [![Code Climate](https://codeclimate.com/github/thejamespinto/bdd/coverage.svg)](https://codeclimate.com/github/thejamespinto/bdd) | [![Code Climate](https://codeclimate.com/github/thejamespinto/bdd.svg)](https://codeclimate.com/github/thejamespinto/bdd) | [![Downloads](http://img.shields.io/gem/dt/bdd.svg)](https://rubygems.org/gems/bdd) | [![GitHub Issues](https://img.shields.io/github/issues/thejamespinto/bdd.svg)](https://github.com/thejamespinto/bdd/issues) |## Compatibility
Ruby 2.0 through 2.7
## Pitch
This gem provides the same benefits as gem Cucumber, and it's easier to use in projects.Works with all ruby test frameworks (RSpec and Minitest).
Works with all test types (Capybara, units, features, etc).1. Take your User Stories.
2. Write them as unobtrusive commentary in your test code.
3. Run your tests.
4. You'll see all your User Stories neatly organized in the output.
5. If your code breaks, that line will be highlighted in red.
[Read more about User Stories on Wikipedia](https://en.wikipedia.org/wiki/User_story).
## Example
1. BEFORE
2. AFTER
3. RUN TESTS
4. CHECK OUTPUT
## Installation
#### Installation For RSpec
```ruby
# Gemfilegroup :development, :test do
gem 'rspec'
gem 'rspec-rails' # if you are using Rails
gem 'bdd'
end
``````ruby
# spec/spec_helper.rb
require 'bdd'Bdd.configure do |config|
config.framework :rspec
config.reporters :output, :yaml
config.language %w[Given], %w[When Then], %w[And But]# Optionally, add other languages:
# config.language pre_conditions, post_conditions, conjunctions
# config.language %w[Dado], %w[Quando Entao], %w[E Mas] # Portuguese
# config.language %w[Dato], %w[Cuando Entonces], %w[Y Mas] # Spanish
# config.language %w[Zakładając], %w[Jeśli To], %w[Także Ale] # Polish
end
```#### Installation For Minitest
```ruby
# Gemfilegroup :development, :test do
gem 'minitest'
gem 'minitest-rails' # if you are using Rails
gem 'bdd'
end
``````ruby
# test/test_helper.rb
require 'bdd'Bdd.configure do |config|
config.framework :minitest
config.reporters :output, :yaml
config.language %w[Given], %w[When Then], %w[And But]# Optionally, add other languages:
# config.language pre_conditions, post_conditions, conjunctions
# config.language %w[Dado], %w[Quando Entao], %w[E Mas] # Portuguese
# config.language %w[Dato], %w[Cuando Entonces], %w[Y Mas] # Spanish
# config.language %w[Zakładając], %w[Jeśli To], %w[Także Ale] # Polish
end
```## Authors & Contributions
* [James Pinto](http://github.com/thejamespinto)
* [Michal Papis](http://github.com/mpapis)## Contributing
1. Fork it ( https://github.com/thejamespinto/bdd/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## Documentation
![Chart](./images/bdd.png)
- Frameworks
- [x] RSpec
- [x] Minitest
- Reporters
- [x] Output
- [x] YAML
- [ ] HTML