{"id":15406460,"url":"https://github.com/odlp/rspec-with_params","last_synced_at":"2025-08-09T00:21:20.695Z","repository":{"id":56893016,"uuid":"186239937","full_name":"odlp/rspec-with_params","owner":"odlp","description":"Simple parameterized testing with RSpec (a.k.a table tests)","archived":false,"fork":false,"pushed_at":"2021-02-16T17:14:26.000Z","size":17,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-04-23T19:37:54.397Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/odlp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-12T10:20:30.000Z","updated_at":"2022-03-28T08:46:45.000Z","dependencies_parsed_at":"2022-08-21T01:50:13.409Z","dependency_job_id":null,"html_url":"https://github.com/odlp/rspec-with_params","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odlp%2Frspec-with_params","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odlp%2Frspec-with_params/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odlp%2Frspec-with_params/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odlp%2Frspec-with_params/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/odlp","download_url":"https://codeload.github.com/odlp/rspec-with_params/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249342112,"owners_count":21254221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T16:23:04.200Z","updated_at":"2025-04-17T12:41:12.931Z","avatar_url":"https://github.com/odlp.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RSpec::WithParams\n\n[![Gem Version](https://badge.fury.io/rb/rspec-with_params.svg)](https://rubygems.org/gems/rspec-with_params) [![CircleCI](https://circleci.com/gh/odlp/rspec-with_params.svg?style=shield)](https://circleci.com/gh/odlp/rspec-with_params)\n\nSimple parameterized testing (a.k.a table tests) with RSpec.\n\n```ruby\nRSpec.describe \"my complex business logic\" do\n  extend RSpec::WithParams::DSL\n\n  with_params(\n    [:today,        :schedule,    :expected_date],\n    [\"2019-06-05\",  \"weekly\",     \"2019-06-13\"],\n    [\"2019-06-05\",  \"bi-weekly\",  \"2019-06-20\"],\n    [\"2019-06-05\",  \"monthly\",    \"2019-07-13\"],\n  ) do\n    it \"determines the next appointment date\" do\n      result = NextAppointmentCalculator.new.process(today, schedule)\n      expect(result).to eq expected_date\n    end\n  end\nend\n```\n\nOutput (with `--format documentation`):\n\n```\nmy complex business logic\n  given today -\u003e \"2019-06-05\", schedule -\u003e \"weekly\", expected_date -\u003e \"2019-06-13\"\n    determines the next appointment date\n  given today -\u003e \"2019-06-05\", schedule -\u003e \"monthly\", expected_date -\u003e \"2019-06-20\"\n    determines the next appointment date\n  given today -\u003e \"2019-06-05\", schedule -\u003e \"bi-weekly\", expected_date -\u003e \"2019-06-20\"\n    determines the next appointment date\n\nFinished in 0.00136 seconds (files took 0.12486 seconds to load)\n3 examples, 0 failures\n```\n\n## Usage\n\n```ruby\n# Gemfile\n\ngroup :test do\n  gem \"rspec-with_params\"\nend\n```\n\nExtend specific test groups:\n\n```ruby\nrequire \"rspec/with_params/dsl\"\n\nRSpec.describe \"my complex business logic\" do\n  extend RSpec::WithParams::DSL\n\n  # examples...\nend\n```\n\nOr configure RSpec globally:\n\n```ruby\nrequire \"rspec/with_params/dsl\"\n\nRSpec.configure do |config|\n  config.extend(RSpec::WithParams::DSL)\nend\n```\n\n## Development\n\n```\ngit clone git@github.com:odlp/rspec-with_params.git\ncd rspec-with_params\nbundle\nbundle exec rake\n```\n\n## Alternatives\n\n- [`rspec-parameterized`][rspec-parameterized] - A slicker (more-complex?) DSL.\n  Inspiration for this library.\n\n[rspec-parameterized]: https://github.com/tomykaira/rspec-parameterized\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodlp%2Frspec-with_params","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fodlp%2Frspec-with_params","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodlp%2Frspec-with_params/lists"}