test/node/test_entrance.rb in zold-0.31.5 vs test/node/test_entrance.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
@@ -47,11 +47,11 @@
[
'pay', '--force', '--private-key=fixtures/id_rsa',
source.id.to_s, target.id.to_s, '19.99', 'testing'
]
)
- IO.read(source.path)
+ File.read(source.path)
end
FakeHome.new(log: test_log).run do |home|
source = home.create_wallet(sid)
target = home.create_wallet(tid)
ledger = File.join(home.dir, 'ledger.csv')
@@ -64,18 +64,18 @@
assert_equal(2, modified.count)
assert_equal(Zold::Amount.new(zld: -19.99), source.balance)
assert_equal(Zold::Amount.new(zld: 19.99), target.balance)
assert(modified.include?(sid))
assert(modified.include?(tid))
- assert_equal(1, IO.read(ledger).split("\n").count)
+ assert_equal(1, File.read(ledger).split("\n").count)
end
end
def test_renders_json
FakeHome.new(log: test_log).run do |home|
wallet = home.create_wallet
e = Zold::Entrance.new(home.wallets, Zold::Pipeline.new(home.remotes, home.copies.root, 'x'), log: test_log)
- e.push(wallet.id, IO.read(wallet.path))
+ e.push(wallet.id, File.read(wallet.path))
assert(e.to_json[:history].include?(wallet.id.to_s))
assert(!e.to_json[:speed].negative?)
end
end
end