{"id":15101465,"url":"https://github.com/viralpraxis/rspec-description_consistency","last_synced_at":"2026-02-11T00:01:58.770Z","repository":{"id":245490838,"uuid":"776768786","full_name":"viralpraxis/rspec-description_consistency","owner":"viralpraxis","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-21T21:20:26.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-22T22:37:00.307Z","etag":null,"topics":["bdd","rspec","runtime-verification"],"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/viralpraxis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-24T12:47:48.000Z","updated_at":"2025-02-21T21:20:28.000Z","dependencies_parsed_at":"2024-06-22T11:40:09.566Z","dependency_job_id":"9ff27b10-33c5-40d1-91db-de0464e3373d","html_url":"https://github.com/viralpraxis/rspec-description_consistency","commit_stats":{"total_commits":12,"total_committers":2,"mean_commits":6.0,"dds":0.08333333333333337,"last_synced_commit":"bba909e4fe6953af03bebe2725943203ea865a57"},"previous_names":["viralpraxis/rspec-description_consistency"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/viralpraxis/rspec-description_consistency","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viralpraxis%2Frspec-description_consistency","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viralpraxis%2Frspec-description_consistency/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viralpraxis%2Frspec-description_consistency/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viralpraxis%2Frspec-description_consistency/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viralpraxis","download_url":"https://codeload.github.com/viralpraxis/rspec-description_consistency/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viralpraxis%2Frspec-description_consistency/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29322733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T20:44:44.282Z","status":"ssl_error","status_checked_at":"2026-02-10T20:44:43.393Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bdd","rspec","runtime-verification"],"created_at":"2024-09-25T18:23:44.329Z","updated_at":"2026-02-11T00:01:58.743Z","avatar_url":"https://github.com/viralpraxis.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rspec::DescriptionConsistency\n\nOne of the basic RSpec [best practices](https://www.betterspecs.org) advises using specific describe block descriptions if it describes a specific method:\n\n```ruby\n# star.rb\n\nclass Star\n  def self.build(*args, **kwargs)\n    '?'\n  end\n\n  def shape\n    '?'\n  end\nend\n```\n\n```ruby\n# star_spec.rb\n\nRSpec.describe Star do\n  describe '.build' do\n    '?'\n  end\n\n  describe '#shape' do\n    '?'\n  end\nend\n```\n\nIf your team follows this convention, you might quickly encounter inconsistencies as your system evolves: you have to make sure that renaming or moving a method is done with appropriate modification to the `describe` block description.\n\nThis gem enforces consistency by checking descriptions against the described object methods at runtime.\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add rspec-description_consistency\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install rspec-description_consistency\n\n## Usage\n\nAdd `RSpec::DescriptionConsistency.bind(config)` to your `spec_helper.rb`:\n\n```ruby\nRSpec.configure do |config|\n  RSpec::DescriptionConsistency.bind config\nend\n```\n\nYou can provide additional configuration via `RSpec::DescriptionConsistency.configure`:\n\n```ruby\nRSpec::DescriptionConsistency.configure do |config|\n  # Set to `false` to disable (default: `true`).\n  config.enabled = true\n\n  # Exit with specific code if any inconsistencies were detected (default: `0`).\n  # If set to `0`, RSpec's exit code will be preserved.\n  config.exit_code = 1\n\n  # Custom output stream (default: `Rspec.configuration.output_stream`).\n  config.output_stream = 'tmp/rspec-description_consistency.txt'\nend\n```\n\nBy default, descriptions are matched against public and protected methods. If you want to indicate that a specific `describe` refers to a private method you can add `private` flag:\n\n```ruby\ndescribe '#some_private_method', :private do # or `private: true`\n  '?'\nend\n```\n\nYou can disable consistency verification completely by specifying `description_consistency: false` for `describe` block:\n\n```ruby\ndescribe '.this_method_will_not_be_checked', description_consistency: false do\n  '?'\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`.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/viralpraxis/rspec-description_consistency. 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/viralpraxis/rspec-description_consistency/blob/main/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 Rspec::DescriptionConsistency project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/viralpraxis/rspec-description_consistency/blob/main/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviralpraxis%2Frspec-description_consistency","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviralpraxis%2Frspec-description_consistency","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviralpraxis%2Frspec-description_consistency/lists"}