Sha256: ed64aaefa3ec9ade9cbec464506e5f881506810b6b17bc409d2c56224a7c2b19

Contents?: true

Size: 947 Bytes

Versions: 4

Compression:

Stored size: 947 Bytes

Contents

require 'spec_helper'
require './lib/renuo_bin_check/printer'

RSpec.describe RenuoBinCheck::Printer do
  let(:printer) { RenuoBinCheck::Printer.new }
  let(:result) { build(:failed_result) }
  let(:results) { [build(:result), build(:result)] }

  it 'prints the given standard_output' do
    expect { printer.print_standard_output(results) }.to output("I passed\nThis is the second line\n" \
                                                        "I passed\nThis is the second line\n").to_stdout
  end

  it 'prints the given error-output' do
    expect { printer.print_error_output(result) }.to output("I failed\nThis is the second line\n").to_stderr
  end

  context 'empty output' do
    let(:result) { build(:failed_result, error_output: '') }

    it 'prints standard_output if no error-output is available' do
      expect { printer.print_error_output(result) }.to output("I passed\nThis is the second line\n").to_stderr
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
renuo-bin-check-1.0.0.beta2 spec/renuo/bin-check/printer_spec.rb
renuo-bin-check-1.0.0.beta1 spec/renuo/bin-check/printer_spec.rb
renuo-bin-check-0.2.1 spec/renuo/bin-check/printer_spec.rb
renuo-bin-check-0.2.0 spec/renuo/bin-check/printer_spec.rb