test/commands/test_pay.rb in zold-0.31.5 vs test/commands/test_pay.rb in zold-0.31.6
- old
+ new
@@ -1,8 +1,8 @@
# frozen_string_literal: true
-# Copyright (c) 2018-2023 Zerocracy, Inc.
+# Copyright (c) 2018-2023 Zerocracy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@@ -86,13 +86,13 @@
def test_pay_with_keygap
FakeHome.new(log: test_log).run do |home|
wallet = home.create_wallet
amount = Zold::Amount.new(zld: 2.0)
Tempfile.open do |f|
- pem = IO.read('fixtures/id_rsa')
+ pem = File.read('fixtures/id_rsa')
keygap = pem[100..120]
- IO.write(f, pem.gsub(keygap, '*' * keygap.length))
+ File.write(f, pem.gsub(keygap, '*' * keygap.length))
Zold::Pay.new(wallets: home.wallets, copies: home.dir, remotes: home.remotes, log: test_log).run(
[
'pay', '--force', "--private-key=#{Shellwords.escape(f.path)}",
"--keygap=#{Shellwords.escape(keygap)}",
wallet.id.to_s, 'NOPREFIX@dddd0000dddd0000', amount.to_zld, '-'
@@ -187,10 +187,10 @@
fund = Zold::Amount.new(zld: 19.99)
10.times do |i|
wallet.add(
Zold::Txn.new(
i + 1,
- Time.now - 24 * 60 * 60 * 365 * 300,
+ Time.now - (24 * 60 * 60 * 365 * 300),
fund,
'NOPREFIX', Zold::Id.new, '-'
)
)
end