test/commands/test_alias.rb in zold-0.15.0 vs test/commands/test_alias.rb in zold-0.16.0
- old
+ new
@@ -9,11 +9,11 @@
# alias set <wallet> <alias>
# @todo #322:30min Implement the set command and unskip this test.
# The syntax is already documented in the alias command in the help.
def test_set_writes_alias_to_the_alias_file
skip
- FakeHome.new.run do |home|
+ FakeHome.new(log: test_log).run do |home|
wallet = home.create_wallet
Zold::Alias.new(wallets: home.wallets, log: test_log).run(%W[set #{wallet.id} my-alias])
assert_equal read_alias_file(home), %W[my-alias #{wallet.id}]
end
end
@@ -21,11 +21,11 @@
# alias remove <alias>
# @todo #322:30min Implement the remove command and unskip this test.
# The syntax is already documented in the alias command in the help.
def test_remove_removes_the_alias_from_the_alias_file
skip
- FakeHome.new.run do |home|
+ FakeHome.new(log: test_log).run do |home|
wallet = home.create_wallet
cmd = Zold::Alias.new(wallets: home.wallets, log: test_log)
cmd.run(%W[set #{wallet.id} my-alias])
assert_equal read_alias_file(home), %W[my-alias #{wallet.id}]
cmd.run(%w[remove my-alias])
@@ -36,11 +36,11 @@
# alias show <alias>
# @todo #322:30min Implement the show command and unskip this test.
# The syntax is already documented in the alias command in the help.
def test_show_prints_out_the_aliased_wallet_id
skip
- FakeHome.new.run do |home|
+ FakeHome.new(log: test_log).run do |home|
wallet = home.create_wallet
cmd = Zold::Alias.new(wallets: home.wallets, log: test_log)
cmd.run(%W[set #{wallet.id} my-alias])
assert_equal read_alias_file(home), %W[my-alias #{wallet.id}]
stdout, = capture_io { cmd.run(%w[show my-alias]) }
@@ -49,8 +49,8 @@
end
private
def read_alias_file(home)
- File.read(File.join(home.dir, 'aliases')).split(' ')
+ IO.read(File.join(home.dir, 'aliases')).split(' ')
end
end