diff --git a/lib/mangopay/version.rb b/lib/mangopay/version.rb index 58eb114..b2fd140 100644 --- a/lib/mangopay/version.rb +++ b/lib/mangopay/version.rb @@ -1,3 +1,3 @@ module MangoPay - VERSION = '3.0.11' + VERSION = '3.0.12' end diff --git a/mangopay.gemspec b/mangopay.gemspec index edbcce8..5af9144 100644 --- a/mangopay.gemspec +++ b/mangopay.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.add_dependency('multi_json', '>= 1.7.7') s.add_development_dependency('rake', '>= 10.1.0') - s.add_development_dependency('rspec', '>= 3.0.0.rc1') + s.add_development_dependency('rspec', '>= 3.0.0') s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- spec/*`.split("\n") diff --git a/spec/mangopay/authorization_token_spec.rb b/spec/mangopay/authorization_token_spec.rb index 71d80c9..005a7ac 100644 --- a/spec/mangopay/authorization_token_spec.rb +++ b/spec/mangopay/authorization_token_spec.rb @@ -54,15 +54,15 @@ file_path = _new_file_storage.file_path dir_path = MangoPay.configuration.temp_dir - expect(file_path.start_with? dir_path).to be_true + expect(file_path.start_with? dir_path).to be(true) token = MangoPay::AuthorizationToken::Manager.get_token - expect(File.exists? file_path).to be_true + expect(File.exists? file_path).to be(true) f = File.open(file_path, File::RDONLY) txt = f.read f.close - expect(txt.include? token['access_token']).to be_true + expect(txt.include? token['access_token']).to be(true) MangoPay::AuthorizationToken::Manager.storage = _default_static_storage # cleanup end diff --git a/spec/mangopay/client_spec.rb b/spec/mangopay/client_spec.rb index 3b50f4e..ceba78e 100644 --- a/spec/mangopay/client_spec.rb +++ b/spec/mangopay/client_spec.rb @@ -10,8 +10,8 @@ it 'refuses the client id' do expect { wrong_client['errors'] }.to raise_error { |err| - err.should be_a MangoPay::ResponseError - err.type.should eq 'param_error' + expect(err).to be_a MangoPay::ResponseError + expect(err.type).to eq 'param_error' } end diff --git a/spec/mangopay/kyc_document_spec.rb b/spec/mangopay/kyc_document_spec.rb index 9ae7426..de8e146 100644 --- a/spec/mangopay/kyc_document_spec.rb +++ b/spec/mangopay/kyc_document_spec.rb @@ -49,9 +49,9 @@ def create_page(file) it 'fails when input string is not base64-encoded' do file = 'any file content...' expect { create_page(file) }.to raise_error { |err| - err.should be_a MangoPay::ResponseError - err.code.should eq '400' - err.type.should eq 'param_error' + expect(err).to be_a MangoPay::ResponseError + expect(err.code).to eq '400' + expect(err.type).to eq 'param_error' } end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d251929..6dd5b25 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,11 +4,14 @@ require 'fileutils' require 'pp' - -MangoPay.configure do |c| - c.preproduction = true - c.client_id = 'sdk-unit-tests' - c.client_passphrase = 'cqFfFrWfCcb7UadHNxx2C9Lo6Djw8ZduLi7J9USTmu8bhxxpju' - c.temp_dir = File.expand_path('../tmp', __FILE__) - FileUtils.mkdir_p(c.temp_dir) unless File.directory?(c.temp_dir) +# (re-called once in configuration_spec) +def reset_mangopay_configuration + MangoPay.configure do |c| + c.preproduction = true + c.client_id = 'sdk-unit-tests' + c.client_passphrase = 'cqFfFrWfCcb7UadHNxx2C9Lo6Djw8ZduLi7J9USTmu8bhxxpju' + c.temp_dir = File.expand_path('../tmp', __FILE__) + FileUtils.mkdir_p(c.temp_dir) unless File.directory?(c.temp_dir) + end end +reset_mangopay_configuration