Skip to content

Commit 13895d9

Browse files
authored
fix: Add condition to check RSpec availability in install generator (#63)
2 parents 759db8d + 6813ed3 commit 13895d9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/generators/graphiti/install_generator.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ def install
4141
RUBY
4242
end
4343

44-
inject_into_file "spec/rails_helper.rb", after: /RSpec.configure.+^end$/m do
45-
"\n\nGraphitiSpecHelpers::RSpec.schema!"
44+
if defined?(RSpec)
45+
inject_into_file "spec/rails_helper.rb", after: /RSpec.configure.+^end$/m do
46+
"\n\nGraphitiSpecHelpers::RSpec.schema!"
47+
end
4648
end
4749

4850
insert_into_file "config/routes.rb", after: "Rails.application.routes.draw do\n" do

0 commit comments

Comments
 (0)