<commit_before>require 'spec_helper'
require 'os'

describe Puppet_X::Coi::Jboss::Internal::Executor::ShellExecutor do
  describe '#run_command' do
    let(:instance) { described_class.new }
    subject { instance.run_command(cmd) }

    context 'with correct command' do
      if OS.windows?
        let(:cmd) { 'dir' }
        it { expect { subject }.to_not raise_error }
      elsif OS.osx?
        let(:cmd) { 'ls' }
        it { expect { subject }.to_not raise_error }
      elsif OS.linux?
        let(:cmd) { 'ls' }
        it { expect { subject }.to_not raise_error }
      end
    end
  end

  describe '#child_status' do
    before :each do
      instance.instance_variable_set(:@result, 'mocked result')
    end

    let(:instance) { described_class.new }
    subject { instance.child_status }

    it { expect(subject).to be_truthy }
  end
end<commit_msg>Fix ShellExecutor test due to random way the tests are performed<commit_after>require 'spec_helper'
require 'os'

describe Puppet_X::Coi::Jboss::Internal::Executor::ShellExecutor do
  describe 'with correct command' do
    let(:instance) { described_class.new }
    let(:execution) { instance.run_command(cmd) }
    let(:status) { instance.child_status }

    if OS.windows?
      let(:cmd) { 'dir' }
    elsif OS.osx?
      let(:cmd) { 'ls' }
    elsif OS.linux?
      let(:cmd) { 'ls' }
    end

    it { expect { execution }.to_not raise_error }
    it { expect(status).to be_truthy }
  end
end
{'fraction_non_alphanumeric': 0.12090163934426229, 'fraction_numerical': 0.0, 'mean_word_length': 2.9809782608695654, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1449247', 'n_tokens_mistral': 489, 'n_tokens_neox': 479, 'n_words': 118}