From 2e861f722d2e1d003e96ea30c9f59ddf439381c8 Mon Sep 17 00:00:00 2001 From: Yohei Kitamura Date: Thu, 26 Apr 2018 11:25:56 +0900 Subject: [PATCH] Fix Travis failing build --- .travis.yml | 15 ++++++++++----- CONTRIBUTING.md | 4 ++-- README.md | 2 +- spec/spec_helper.rb | 9 +++++++++ 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 658a386..d6c5d14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,15 +3,20 @@ cache: bundler sudo: false rvm: - - 2.2.5 - - 2.3.1 - -env: - - MAUTH_CONFIG_YML=`pwd`/spec/config_root/config/mauth.yml + - 2.2.10 + - 2.3.7 + - 2.4.4 + - 2.5.1 matrix: include: - rvm: 2.1.10 gemfile: gemfiles/ruby_2.1.gemfile +# https://github.com/travis-ci/travis-ci/issues/8978 +before_install: + - gem update --system + - gem install bundler # https://github.com/travis-ci/travis-ci/issues/9383 + - bundle --version + script: "bundle exec rspec" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 494ee9e..6b9f0be 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,8 +13,8 @@ To run tests, first run `bundle install`. -Next, run the tests with an appropriate mauth config file, typically this is done by passing the provided one using an environment variable: +Next, run the tests: ``` -MAUTH_CONFIG_YML=`pwd`/spec/config_root/config/mauth.yml bundle exec rspec +bundle exec rspec ``` diff --git a/README.md b/README.md index ba8dd7f..8d5dc5e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # MAuth Client -[![Build Status](https://travis-ci.org/mdsol/mauth-client-ruby.svg)](https://travis-ci.org/mdsol/mauth-client-ruby) +[![Build Status](https://travis-ci.org/mdsol/mauth-client-ruby.svg?branch=master)](https://travis-ci.org/mdsol/mauth-client-ruby) This gem consists of MAuth::Client, a class to manage the information needed to both sign and authenticate requests and responses, and middlewares for Rack and Faraday which leverage the client's capabilities. diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 45949eb..e036dd4 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,3 +5,12 @@ require 'simplecov' SimpleCov.start + +MAUTH_CONFIG_YML = File.expand_path('../config_root/config/mauth.yml', __FILE__).freeze + +RSpec.configure do |config| + config.before do + allow(ENV).to receive(:[]).and_call_original + allow(ENV).to receive(:[]).with('MAUTH_CONFIG_YML').and_return(MAUTH_CONFIG_YML) + end +end