{"id":31725182,"url":"https://github.com/drexed/cmdx-rspec","last_synced_at":"2026-01-20T17:52:22.636Z","repository":{"id":311537813,"uuid":"1043993526","full_name":"drexed/cmdx-rspec","owner":"drexed","description":"Collection of RSpec matchers","archived":false,"fork":false,"pushed_at":"2025-09-30T21:38:07.000Z","size":182,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-07T14:38:51.653Z","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/drexed.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-25T03:03:33.000Z","updated_at":"2025-09-30T21:38:11.000Z","dependencies_parsed_at":"2025-08-25T06:02:28.087Z","dependency_job_id":"b5b03d67-7007-41a2-991b-4c37bd9a2926","html_url":"https://github.com/drexed/cmdx-rspec","commit_stats":null,"previous_names":["drexed/cmdx-rspec"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/drexed/cmdx-rspec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drexed%2Fcmdx-rspec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drexed%2Fcmdx-rspec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drexed%2Fcmdx-rspec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drexed%2Fcmdx-rspec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drexed","download_url":"https://codeload.github.com/drexed/cmdx-rspec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drexed%2Fcmdx-rspec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000739,"owners_count":26082933,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-10-09T05:21:10.803Z","updated_at":"2026-01-20T17:52:22.623Z","avatar_url":"https://github.com/drexed.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./src/cmdx-light-logo.png#gh-light-mode-only\" width=\"200\" alt=\"CMDx Logo\"\u003e\n  \u003cimg src=\"./src/cmdx-dark-logo.png#gh-dark-mode-only\" width=\"200\" alt=\"CMDx Logo\"\u003e\n\n  ---\n\n  Collection of RSpec matchers for the CMDx framework.\n\n  [Changelog](./CHANGELOG.md) · [Report Bug](https://github.com/drexed/cmdx-rspec/issues) · [Request Feature](https://github.com/drexed/cmdx-rspec/issues)\n\n  \u003cimg alt=\"Version\" src=\"https://img.shields.io/gem/v/cmdx-rspec\"\u003e\n  \u003cimg alt=\"Build\" src=\"https://github.com/drexed/cmdx-rspec/actions/workflows/ci.yml/badge.svg\"\u003e\n  \u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/drexed/cmdx-rspec\"\u003e\n\u003c/div\u003e\n\n# CMDx::RSpec\n\nCollection of RSpec matchers for [CMDx](https://github.com/drexed/cmdx).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'cmdx-rspec'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install cmdx-rspec\n\n## Matchers\n\n### be_successful\n\nAsserts that a CMDx task result indicates successful execution.\n\n```ruby\nit \"returns success\" do\n  result = SomeTask.execute\n\n  expect(result).to be_successful\nend\n```\n\n### have_skipped\n\nAsserts that a CMDx task result indicates the task was skipped during execution.\n\n```ruby\nit \"returns skipped\" do\n  result = SomeTask.execute\n\n  # Default result\n  expect(result).to have_skipped\n\n  # Custom result\n  expect(result).to have_skipped(\n    reason: \"Skipping for a custom reason\",\n    cause: be_a(CMDx::SkipFault)\n    # Other members of `result.to_h`...\n  )\nend\n```\n\n### have_failed\n\nAsserts that a CMDx task result indicates execution failure.\n\n```ruby\nit \"returns failure\" do\n  result = SomeTask.execute\n\n  # Default result\n  expect(result).to have_failed\n\n  # Custom result\n  expect(result).to have_failed(\n    reason: \"Failed for a custom reason\",\n    cause: be_a(NoMethodError)\n    # Other members of `result.to_h`...\n  )\nend\n```\n\n### have_empty_metadata\n\nAsserts that a CMDx task result has no metadata.\n\n```ruby\nit \"returns empty metadata\" do\n  result = SomeTask.execute\n\n  expect(result).to have_empty_metadata\nend\n```\n\n### have_matching_metadata\n\nAsserts that a CMDx task result contains specific metadata.\n\n```ruby\nit \"returns matching metadata\" do\n  result = SomeTask.execute\n\n  expect(result).to have_matching_metadata(status_code: 500)\nend\n```\n\n### have_empty_context\n\nAsserts that a CMDx task result has no context data.\n\n```ruby\nit \"returns empty context\" do\n  result = SomeTask.execute\n\n  expect(result).to have_empty_context\nend\n```\n\n### have_matching_context\n\nAsserts that a CMDx task result contains specific context data.\n\n```ruby\nit \"returns matching context\" do\n  result = SomeTask.execute\n\n  expect(result).to have_matching_context(stored_result: 123)\nend\n```\n\n### be_deprecated\n\nAsserts that a CMDx task result indicates the task is deprecated.\n\n```ruby\nit \"returns deprecated\" do\n  expect(SomeTask).to be_deprecated\nend\n```\n\n## Helpers\n\n### Including Helper Modules\n\nInclude the helper modules in your RSpec configuration or example groups:\n\n```ruby\nRSpec.configure do |config|\n  config.include CMDx::RSpec::Helpers\nend\n```\n\nOr include them in specific example groups:\n\n```ruby\ndescribe MyFeature do\n  include CMDx::RSpec::Helpers\n\n  # Your specs...\nend\n```\n\n### Stubs\n\nHelper methods for stubbing CMDx command execution.\n\n#### Types\n\n```ruby\nit \"stubs task executions by type\" do\n  # eg: SomeTask.execute\n  stub_task_success(SomeTask)\n  stub_task_skip(SomeTask)\n  stub_task_fail(SomeTask)\n\n  # eg: SomeTask.execute!\n  stub_task_success!(SomeTask)\n  stub_task_skip!(SomeTask)\n  stub_task_fail!(SomeTask)\n\n  # Your specs...\nend\n\nit \"stubs task with arguments\" do\n  # eg: SomeTask.execute(some: \"value\")\n  stub_task_success(SomeTask, some: \"value\")\n\n  # eg: SomeTask.execute!(some: \"value\")\n  stub_task_skip!(SomeTask, some: \"value\")\n\n  # Your specs...\nend\n```\n\n#### Options\n\n```ruby\nit \"stubs task with metadata\" do\n  stub_task_success(SomeTask, metadata: { some: \"value\" })\n\n  # Your specs...\nend\n\nit \"stubs task with a custom reason\" do\n  stub_task_skip!(SomeTask, reason: \"Skipping for a custom reason\")\n\n  # Your specs...\nend\n\nit \"stubs task with a custom cause\" do\n  stub_task_fail!(SomeTask, cause: NoMethodError.new(\"just blow it up\"))\n\n  # Your specs...\nend\n```\n\n#### Reset\n\n```ruby\nit \"unstubs task executions by type\" do\n  # eg: SomeTask.execute\n  unstub_task(SomeTask)\n\n  # eg: SomeTask.execute!\n  unstub_task!(SomeTask)\n\n  # Your specs...\nend\n\nit \"unstubs task with arguments\" do\n  # eg: SomeTask.execute(some: \"value\")\n  unstub_task(SomeTask, some: \"value\")\n\n  # eg: SomeTask.execute!(some: \"value\")\n  unstub_task!(SomeTask, some: \"value\")\n\n  # Your specs...\nend\n```\n\n### Mocks\n\nHelper methods for setting expectations on CMDx command execution.\n\n#### Types\n\n```ruby\nit \"mocks task executions by type\" do\n  # eg: SomeTask.execute\n  expect_task_execution(SomeTask)\n  expect_no_task_execution(SomeTask)\n\n  # eg: SomeTask.execute!\n  expect_task_execution!(BangCommand)\n  expect_no_task_execution!(SomeTask)\n\n  # Your specs...\nend\n\nit \"mocks task with arguments\" do\n  # eg: SomeTask.execute(some: \"value\")\n  expect_task_execution(SomeTask, some: \"value\")\n  expect_no_task_execution(SomeTask, some: \"value\")\n\n  # eg: SomeTask.execute!(some: \"value\")\n  expect_task_execution!(SomeTask, some: \"value\")\n  expect_no_task_execution!(SomeTask, some: \"value\")\n\n  # Your specs...\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/drexed/cmdx-rspec. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/drexed/cmdx-rspec/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Cmdx::Rspec project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/drexed/cmdx-rspec/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrexed%2Fcmdx-rspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrexed%2Fcmdx-rspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrexed%2Fcmdx-rspec/lists"}