Sha256: cb807b6f4526c4acb9eedb2540dfb19e86da017bd63726a05b0bd2db5b7bd949

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

#encoding: utf-8

require 'spec_helper'

describe Formatter::XML do
  before :each do
    @formatter = Formatter::XML.new
  end

  it "outputs data as XML string" do
      @formatter.stderr(["output of stderr"])
      @formatter.stdout("output of stdout")
      @formatter.log_file("output of log file")
      @formatter.return_code("output of return code")
      @formatter.pid(4711)
      @formatter.status(:failed)
      @formatter.executable('/usr/bin/true')

      expect(@formatter.output(:stdout,:stderr)).to eq("<command>\n  <stdout>output of stdout</stdout>\n  <stderr>output of stderr</stderr>\n</command>\n")
  end

  it "outputs data as XML string (attributes with multiple values)" do
      @formatter.stderr(["output of stderr 1/2", "output of stderr 2/2"])
      @formatter.stdout("output of stdout")
      @formatter.log_file("output of log file")
      @formatter.return_code("output of return code")
      @formatter.pid(4711)
      @formatter.status(:failed)
      @formatter.executable('/usr/bin/true')

      expect(@formatter.output(:stdout,:stderr)).to eq("<command>\n  <stdout>output of stdout</stdout>\n  <stderr>output of stderr 1/2</stderr>\n  <stderr>output of stderr 2/2</stderr>\n</command>\n")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
command_exec-0.2.0 spec/formatter/xml_spec.rb