Skip to content

Commit

Permalink
A few fixes after last merge
Browse files Browse the repository at this point in the history
Mainly tests fixing
  • Loading branch information
Sergiusz Woźnicki committed Aug 26, 2014
1 parent 88583c2 commit cca87ae
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/mangopay/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module MangoPay
VERSION = '3.0.11'
VERSION = '3.0.12'
end
2 changes: 1 addition & 1 deletion mangopay.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions spec/mangopay/authorization_token_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/mangopay/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions spec/mangopay/kyc_document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 10 additions & 7 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit cca87ae

Please sign in to comment.