Skip to content

Commit

Permalink
Add Graphiti setup for Guard
Browse files Browse the repository at this point in the history
Thanks to @Samsinite for sharing the fix here:
graphiti-api/guard-rspec-graphiti#3 (comment)
  • Loading branch information
backspace committed Jul 28, 2024
1 parent 1bf3ca4 commit 1b92f09
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions waydowntown/waydowntown_server/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ group :development, :test do

gem 'guard'
gem 'guard-rspec', require: false
gem 'guard-rspec-graphiti', require: false
end

group :development do
Expand Down
4 changes: 4 additions & 0 deletions waydowntown/waydowntown_server/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ GEM
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
guard-rspec-graphiti (1.0.1)
graphiti
guard-rspec
i18n (1.14.5)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
Expand Down Expand Up @@ -360,6 +363,7 @@ DEPENDENCIES
graphiti_spec_helpers
guard
guard-rspec
guard-rspec-graphiti
kaminari (~> 1.1)
pg (~> 1.5)
puma (>= 5.0)
Expand Down
10 changes: 10 additions & 0 deletions waydowntown/waydowntown_server/Guardfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,14 @@ guard :rspec, cmd: 'bundle exec rspec' do # rubocop:disable Metrics/BlockLength
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance'
end

# Needed for inflections used by Guard::RSpec::Graphiti
# https://github.com/graphiti-api/guard-rspec-graphiti/issues/3#issue-637891061
require 'active_support'
require 'guard/rspec/graphiti/dsl'
require 'active_support/core_ext/string/inflections'
graphiti = Guard::RSpec::Graphiti::Dsl.new(self, dsl)

graphiti.watch_resources
graphiti.watch_models
end

0 comments on commit 1b92f09

Please sign in to comment.