{"id":18497078,"url":"https://github.com/graphiti-api/guard-rspec-graphiti","last_synced_at":"2025-07-31T00:38:43.104Z","repository":{"id":56875542,"uuid":"177860073","full_name":"graphiti-api/guard-rspec-graphiti","owner":"graphiti-api","description":"Guard-rspec DSL extensions for Graphiti","archived":false,"fork":false,"pushed_at":"2023-01-20T15:14:00.000Z","size":15,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-15T15:25:59.297Z","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/graphiti-api.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-03-26T20:01:36.000Z","updated_at":"2020-08-11T11:14:30.000Z","dependencies_parsed_at":"2023-02-12T03:01:36.933Z","dependency_job_id":null,"html_url":"https://github.com/graphiti-api/guard-rspec-graphiti","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/graphiti-api/guard-rspec-graphiti","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphiti-api%2Fguard-rspec-graphiti","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphiti-api%2Fguard-rspec-graphiti/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphiti-api%2Fguard-rspec-graphiti/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphiti-api%2Fguard-rspec-graphiti/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphiti-api","download_url":"https://codeload.github.com/graphiti-api/guard-rspec-graphiti/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphiti-api%2Fguard-rspec-graphiti/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266509235,"owners_count":23940440,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":"2024-11-06T13:33:17.974Z","updated_at":"2025-07-31T00:38:43.050Z","avatar_url":"https://github.com/graphiti-api.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Guard::Rspec::Graphiti\n\n`guard-rspec-graphiti` is a utility gem for extending the DSL provided by [`guard-rspec`](https://github.com/guard/guard-rspec) to support the new app concepts and test types provided by [Graphiti](https://github.com/graphiti-api/graphiti).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'guard-rspec-graphiti', groups: [:development]\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install guard-rspec-graphiti\n\n## Usage\n\n### Standard Setup\n\nThis gem is designed to be used to extend the default guard-rspec template so that changes to your models and\nGraphiti resources will trigger the appropriate resource and API specs. Given a guard-rspec configuration\nblock:\n\n```ruby\nguard :rspec, cmd: \"bundle exec rspec\" do\n  require \"guard/rspec/dsl\"\n  dsl = Guard::RSpec::Dsl.new(self)\n\n  rspec = dsl.rspec\n  watch(rspec.spec_helper) { rspec.spec_dir }\n  watch(rspec.spec_support) { rspec.spec_dir }\n  watch(rspec.spec_files)\n  # ...\n  # remaining setup\n  #\nend\n```\n\nWe need to require the graphiti dsl setup the default watchers:\n\n```ruby\nguard :rspec, cmd: \"bundle exec rspec\" do\n  require \"guard/rspec/dsl\"\n  dsl = Guard::RSpec::Dsl.new(self)\n\n  # Add everything below this somewhere in your `guard :rspec` block\n  require 'guard/rspec/graphiti/dsl'\n  graphiti = Guard::RSpec::Graphiti::Dsl.new(self, dsl)\n\n  graphiti.watch_resources\n  graphiti.watch_models\nend\n```\n\nAnd that's it! Now whenever you change `app/models/post.rb`, the specs in\n`spec/resources/post` and `spec/api/posts` will automatically run.\n\n### Custom Watchers\n\nIf you have a non-standard setup or wish to add some additional control and watchers, you the dsl also\nexposes some lower-level items to allow you to compose your setup a bit more granularly:\n\n- `graphiti.resources`: A regex to match `app/resources`, with a match group for the resource name\n- `graphiti.resource_specs`: The path to the spec directory for resource specs. Accepts an optional\n  parameter of the resource name, which will only return the directory for the specific resource\n- `graphiti.api_specs`: The path to the spec directory for e2e API specs. Accepts an optional\n  parameter of the resource name, which will only return the directory for the specific API specs\n  for that resource.  Like graphiti, this will default to `specs/api/v1` as the root directory, but\n  if the project has a `.graphiticfg.yml`, it will attempt to replace this with the `namespace`\n  configuration option.\n\n## Development\n\nBug reports and pull requests are welcome on GitHub at https://github.com/graphiti-api/guard-rspec-graphiti.\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%2Fgraphiti-api%2Fguard-rspec-graphiti","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphiti-api%2Fguard-rspec-graphiti","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphiti-api%2Fguard-rspec-graphiti/lists"}