{"id":24389472,"url":"https://github.com/nikitug/rspec-stepwise","last_synced_at":"2025-12-28T22:32:44.904Z","repository":{"id":56892972,"uuid":"193235226","full_name":"nikitug/rspec-stepwise","owner":"nikitug","description":"Stepwise execution DSL for RSpec.","archived":false,"fork":false,"pushed_at":"2019-06-22T13:28:50.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-05T06:02:30.047Z","etag":null,"topics":["integration-testing","rspec"],"latest_commit_sha":null,"homepage":"","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/nikitug.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-06-22T13:08:52.000Z","updated_at":"2019-06-22T13:32:21.000Z","dependencies_parsed_at":"2022-08-20T16:10:40.203Z","dependency_job_id":null,"html_url":"https://github.com/nikitug/rspec-stepwise","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikitug%2Frspec-stepwise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikitug%2Frspec-stepwise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikitug%2Frspec-stepwise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikitug%2Frspec-stepwise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikitug","download_url":"https://codeload.github.com/nikitug/rspec-stepwise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243302276,"owners_count":20269483,"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":["integration-testing","rspec"],"created_at":"2025-01-19T15:33:46.057Z","updated_at":"2025-12-28T22:32:39.884Z","avatar_url":"https://github.com/nikitug.png","language":"Ruby","readme":"# RSpec Stepwise Executor\n\nProvides a simple DSL on top of RSpec for defining a series of spec execution steps. Particularly useful for describing of human-readable integration testing scenarios.\n\nRSpec Stepwise provides the following guarantees within the same steps group:\n\n- Strict step execution order, even if RSpec is configured to run examples randomly.\n- All steps share the same execution context, thus share instances defined in `let` etc.\n- All steps after the failed one will be skipped.\n\n## Usage\n\nConfigure RSpec to use stepwise DSL:\n\n```ruby\nrequire 'rspec/stepwise'\n\nRSpec.configure do |config|\n  config.extend RSpec::Stepwise\n  # ...\nend\n```\n\nThis adds `stepwise` method for creating ordered example groups and `step` method for describing particular step in a chain. See full usage example:\n\n```ruby\nRSpec.describe 'User Scenarios' do\n  # Defines example group for account confirmation scenario.\n  # All steps within this group will run in an order.\n  stepwise 'Account Confirmation' do\n    # All RSpec APIs works as usual inside both group and steps.\n    let(:api) { ClientApi.new }\n    let(:mailbox) { Mailbox.new }\n    let(:user) { User.new }\n\n    step 'register' do\n      api.register(user)\n    end\n\n    step 'unable to sign in' do\n      response = api.sign_in(user)\n      expect(response).to be_forbidden\n    end\n\n    step 'confirm' do\n      mailbox.confirm(user)\n      fail 'Email not found in mailbox'\n    end\n\n    # This step will not be executed because previous one failed.\n    step 'successfully sign in' do\n      response = api.sign_in(user)\n      expect(response).to be_successfull\n    end\n\n    # Called after all steps, even if one failed.\n    after do\n      mailbox.clear\n    end\n\n    # Called only when a step failed.\n    on_fail do\n      puts api.logs\n    end\n  end\nend\n```\n\n## Known Limitations\n\nRSpec doubles should not be used in a shared stepwise context, otherwise it leads to:\n\n_#\u003cDouble ...\u003e was originally created in one example but has leaked into another example and can no longer be used. rspec-mocks' doubles are designed to only last for one example, and you need to create a new one in each example you wish to use it for._\n\nSo this will not work:\n\n```ruby\nstepwise do\n  let(:api) { double(:api, call: nil) }\n\n  step 'one' do\n    api.call\n  end\n\n  step 'another' do\n    api.call\n  end\nend\n```\n\nInstead you have to do something like:\n\n```ruby\nstepwise do\n  step 'one' do\n    api = double(:api, call: nil)\n    api.call\n  end\n\n  step 'another' do\n    api = double(:api, call: nil)\n    api.call\n  end\nend\n```\n\n## Installation\n\nUsing Bundler:\n\n```ruby\ngem 'rspec-stepwise', '~\u003e 0.1.0'\n```\n\nOr using rubygems:\n\n```bash\ngem install rspec-stepwise\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/nikitug/rspec-stepwise.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikitug%2Frspec-stepwise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikitug%2Frspec-stepwise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikitug%2Frspec-stepwise/lists"}