Sha256: db9bfdc5d4e2b3c7d002cd967436982ae82e418a5d791a13e50afeb1cebb8754

Contents?: true

Size: 694 Bytes

Versions: 7

Compression:

Stored size: 694 Bytes

Contents

require 'test_helper'
require 'omf_common/command'

describe OmfCommon::Command do
  describe "when use util file to execute a system command" do
    it "must not print anything to stdout if executed successfully" do
      OmfCommon::Command.execute("ruby -e 'puts 100'").must_match /100/
    end

    it "must capture and log errors if command not found" do
      OmfCommon::Command.execute("blahblah -z").must_be_nil
    end

    it "must log error when exit status is not 0" do
      OmfCommon::Command.execute("ruby -e 'exit 1'").must_be_nil
      OmfCommon::Command.execute("ruby -e 'exit 2'").must_be_nil
      OmfCommon::Command.execute("ruby -e 'exit 3'").must_be_nil
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
omf_common-6.0.2.pre.2 test/omf_common/command_spec.rb
omf_common-6.0.2.pre.1 test/omf_common/command_spec.rb
omf_common-6.0.0 test/omf_common/command_spec.rb
omf_common-6.0.0.pre.11 test/omf_common/command_spec.rb
omf_common-6.0.0.pre.10 test/omf_common/command_spec.rb
omf_common-6.0.0.pre.8 test/omf_common/command_spec.rb
omf_common-6.0.0.pre.7 test/omf_common/command_spec.rb