Description: Fall back to the installed gem if lib doesn't exist
Author: Simon Quigley <tsimonq2@debian.org>
Origin: vendor
Last-Update: 2026-02-23
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,8 +1,13 @@
 # frozen_string_literal: true
 
 require "pry"
-require_relative "../lib/retriable"
-require_relative "support/exceptions"
+begin
+  require_relative "../lib/retriable"
+  require_relative "support/exceptions"
+rescue LoadError
+  require "retriable"
+  require "support/exceptions"
+end
 
 RSpec.configure do |config|
   config.before(:each) do
--- a/spec/retriable_spec.rb
+++ b/spec/retriable_spec.rb
@@ -27,7 +27,11 @@ describe Retriable do
     end
 
     it "can be called once the kernel extension is required" do
-      require_relative "../lib/retriable/core_ext/kernel"
+      begin
+        require_relative "../lib/retriable/core_ext/kernel"
+      rescue LoadError
+        require "retriable/core_ext/kernel"
+      end
 
       expect { retriable { increment_tries_with_exception } }.to raise_error(StandardError)
       expect(@tries).to eq(3)
