Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

Commit 386dbc0

Browse files
author
Ryan Daigle
committed
Use minitest for better Ruby compatability
1 parent d80686d commit 386dbc0

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

Gemfile.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ GEM
1717
specs:
1818
macaddr (1.7.1)
1919
systemu (~> 2.6.2)
20+
minitest (5.11.3)
2021
rake (12.0.0)
2122
systemu (2.6.5)
2223

@@ -27,7 +28,8 @@ DEPENDENCIES
2728
aead!
2829
bundler (~> 1.14)
2930
gala!
31+
minitest
3032
rake (~> 12.0)
3133

3234
BUNDLED WITH
33-
1.14.6
35+
1.15.4

gala.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ Gem::Specification.new do |spec|
2525

2626
spec.add_development_dependency 'bundler', '~> 1.14'
2727
spec.add_development_dependency 'rake', '~> 12.0'
28+
spec.add_development_dependency 'minitest'
2829
end

test/payment_token_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
$LOAD_PATH.push File.expand_path("../lib", __FILE__)
2-
require 'test/unit'
2+
require 'minitest/autorun'
33
require 'json'
44
require 'gala'
55

6-
class Gala::PaymentTokenTest < Test::Unit::TestCase
6+
class Gala::PaymentTokenTest < Minitest::Test
77

88
def setup
99
fixtures = File.dirname(__FILE__) + "/fixtures/"
@@ -45,7 +45,7 @@ def test_decrypt
4545
assert_equal "200731", payment_data["applicationExpirationDate"]
4646
assert_equal "840", payment_data["currencyCode"]
4747
assert_equal 100, payment_data["transactionAmount"]
48-
assert_equal nil, payment_data["cardholderName"]
48+
assert_nil payment_data["cardholderName"]
4949
assert_equal "040010030273", payment_data["deviceManufacturerIdentifier"]
5050
assert_equal "3DSecure", payment_data["paymentDataType"]
5151
assert_equal "Af9x/QwAA/DjmU65oyc1MAABAAA=", payment_data["paymentData"]["onlinePaymentCryptogram"]
@@ -54,7 +54,7 @@ def test_decrypt
5454

5555
def test_failed_decrypt
5656
@payment_token.data = "bogus4OZho15e9Yp5K0EtKergKzeRpPAjnKHwmSNnagxhjwhKQ5d29sfTXjdbh1CtTJ4DYjsD6kfulNUnYmBTsruphBz7RRVI1WI8P0LrmfTnImjcq1mi"
57-
exception = assert_raise Gala::PaymentToken::InvalidSignatureError do
57+
exception = assert_raises Gala::PaymentToken::InvalidSignatureError do
5858
JSON.parse(@payment_token.decrypt(@certificate, @private_key))
5959
end
6060
assert_equal("The given signature is not a valid ECDSA signature.", exception.message)

0 commit comments

Comments
 (0)