Skip to content

Commit 5eeaaf1

Browse files
authored
Merge pull request #5 from rspec-parameterized/doc
Write doc
2 parents 303fe42 + 1bc8242 commit 5eeaaf1

File tree

1 file changed

+31
-16
lines changed

1 file changed

+31
-16
lines changed

README.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,39 @@
11
# Rspec::Parameterized::TableSyntax
2+
`rspec-parameterized-table_syntax` provides table syntax extension for [rspec-parameterized](https://github.com/tomykaira/rspec-parameterized).
23

3-
TODO: Delete this and the text below, and describe your gem
4-
5-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rspec/parameterized/table_syntax`. To experiment with that code, run `bin/console` for an interactive prompt.
4+
[![Gem Version](https://badge.fury.io/rb/rspec-parameterized-table_syntax.svg)](https://badge.fury.io/rb/rspec-parameterized-table_syntax)
5+
[![RSpec](https://github.com/rspec-parameterized/rspec-parameterized-table_syntax/actions/workflows/rspec.yml/badge.svg)](https://github.com/rspec-parameterized/rspec-parameterized-table_syntax/actions/workflows/rspec.yml)
66

77
## Installation
8-
9-
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10-
11-
Install the gem and add to the application's Gemfile by executing:
12-
13-
$ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
14-
15-
If bundler is not being used to manage dependencies, install the gem by executing:
16-
17-
$ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
8+
```ruby
9+
# Install all components
10+
group :test do
11+
gem "rspec-parameterized", ">= 1.0.0"
12+
end
13+
14+
# Install only rspec-parameterized-table_syntax
15+
group :test do
16+
gem "rspec-parameterized-table_syntax", ">= 1.0.0"
17+
end
18+
```
1819

1920
## Usage
20-
21-
TODO: Write usage instructions here
21+
### Table Syntax Style (like Groovy spock)
22+
```ruby
23+
describe "plus" do
24+
using RSpec::Parameterized::TableSyntax
25+
where(:a, :b, :answer) do
26+
1 | 2 | 3
27+
5 | 8 | 13
28+
0 | 0 | 0
29+
end
30+
with_them do
31+
it "should do additions" do
32+
expect(a + b).to eq answer
33+
end
34+
end
35+
end
36+
```
2237

2338
## Development
2439

@@ -28,7 +43,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
2843

2944
## Contributing
3045

31-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rspec-parameterized-table_syntax.
46+
Bug reports and pull requests are welcome on GitHub at https://github.com/rspec-parameterized/rspec-parameterized-table_syntax.
3247

3348
## License
3449

0 commit comments

Comments
 (0)