Sha256: cfb26d36065ac2f94fdefd690808783524f7b054fd7ad819c6bc3aaa33946d6a
Contents?: true
Size: 569 Bytes
Versions: 1
Compression:
Stored size: 569 Bytes
Contents
# frozen_string_literal: true require 'fileutils' RSpec.describe TTY::Command, ':output', type: :cli do it 'runs command and prints to a file' do stub_const('Tee', Class.new do def initialize(file) @file = file end def <<(message) @file << message @file.close end end) file = tmp_path('foo.log') output = Tee.new(File.open(file, 'w')) command = TTY::Command.new(output: output, printer: :quiet) command = command.run("echo hello") expect(File.read(file).chomp).to eq("hello") end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tty-command-0.9.0 | spec/unit/output_spec.rb |