test/node/test_entrance.rb in zold-0.26.16 vs test/node/test_entrance.rb in zold-0.26.17

- old
+ new

@@ -27,10 +27,11 @@ require_relative '../../lib/zold/wallets' require_relative '../../lib/zold/remotes' require_relative '../../lib/zold/id' require_relative '../../lib/zold/key' require_relative '../../lib/zold/node/entrance' +require_relative '../../lib/zold/node/pipeline' require_relative '../../lib/zold/commands/pay' # ENTRANCE test. # Author:: Yegor Bugayenko (yegor256@gmail.com) # Copyright:: Copyright (c) 2018 Yegor Bugayenko @@ -52,11 +53,15 @@ 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') - e = Zold::Entrance.new(home.wallets, home.remotes, home.copies(source).root, 'x', ledger: ledger, log: test_log) + e = Zold::Entrance.new( + home.wallets, + Zold::Pipeline.new(home.remotes, home.copies(source).root, 'x', ledger: ledger), + log: test_log + ) modified = e.push(source.id, body) 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)) @@ -66,10 +71,10 @@ end def test_renders_json FakeHome.new(log: test_log).run do |home| wallet = home.create_wallet - e = Zold::Entrance.new(home.wallets, home.remotes, home.copies.root, 'x', log: test_log) + 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)) assert(e.to_json[:history].include?(wallet.id.to_s)) assert(!e.to_json[:speed].negative?) end end