aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/spec/spec_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'src/ruby/spec/spec_helper.rb')
-rw-r--r--src/ruby/spec/spec_helper.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ruby/spec/spec_helper.rb b/src/ruby/spec/spec_helper.rb
index 3322674e97..ea0a256713 100644
--- a/src/ruby/spec/spec_helper.rb
+++ b/src/ruby/spec/spec_helper.rb
@@ -27,10 +27,22 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+spec_dir = File.expand_path(File.dirname(__FILE__))
+root_dir = File.expand_path(File.join(spec_dir, '..'))
+lib_dir = File.expand_path(File.join(root_dir, 'lib'))
+
+$LOAD_PATH.unshift(spec_dir)
+$LOAD_PATH.unshift(lib_dir)
+$LOAD_PATH.uniq!
+
+require 'faraday'
require 'rspec'
require 'logging'
require 'rspec/logging_helper'
+# Allow Faraday to support test stubs
+Faraday::Adapter.load_middleware(:test)
+
# Configure RSpec to capture log messages for each test. The output from the
# logs will be stored in the @log_output variable. It is a StringIO instance.
RSpec.configure do |config|