<commit_before>require 'spec_helper'
require 'parallel_calabash'

describe ParallelCalabash::Runner do
  describe :command_for_process do
    it 'should return command with env variables' do
      ParallelCalabash::AdbHelper.should_receive(:device_for_process).with(0).and_return("5555")
      expect(ParallelCalabash::Runner.command_for_process(0, 'base_command')).to eq \
      "AUTOTEST=1;export AUTOTEST ADB_DEVICE_ARG=5555;export ADB_DEVICE_ARG TEST_PROCESS_NUMBER=1;export TEST_PROCESS_NUMBER;base_command"
    end
  end


  describe :execute_command_for_process do
    it 'should execute the command with correct env variables set and return exit status 0 when command gets executed successfully' do
      ParallelCalabash::AdbHelper.should_receive(:device_for_process).with(3).and_return("DEVICE3")
      expect(ParallelCalabash::Runner.execute_command_for_process(3,'echo $ADB_DEVICE_ARG;echo $TEST_PROCESS_NUMBER',true)).to eq ({:stdout=>"DEVICE3\n4\n", :exit_status=>0})
    end

    it 'should return exit status of 1' do
      expect(ParallelCalabash::Runner.execute_command_for_process(3,"ruby -e 'exit(1)'",true)).to eq ({:stdout=>"", :exit_status=>1})
    end
  end

end<commit_msg>fixing a failing test after adding suppor for windows<commit_after>require 'spec_helper'
require 'parallel_calabash'

describe ParallelCalabash::Runner do
  describe :command_for_process do
    it 'should return command with env variables' do
      ParallelCalabash::AdbHelper.should_receive(:device_for_process).with(0).and_return("5555")
      expect(ParallelCalabash::Runner.command_for_process(0, 'base_command')).to eq \
      "AUTOTEST=1;export AUTOTEST;ADB_DEVICE_ARG=5555;export ADB_DEVICE_ARG;TEST_PROCESS_NUMBER=1;export TEST_PROCESS_NUMBER;base_command"
    end
  end


  describe :execute_command_for_process do
    it 'should execute the command with correct env variables set and return exit status 0 when command gets executed successfully' do
      ParallelCalabash::AdbHelper.should_receive(:device_for_process).with(3).and_return("DEVICE3")
      expect(ParallelCalabash::Runner.execute_command_for_process(3,'echo $ADB_DEVICE_ARG;echo $TEST_PROCESS_NUMBER',true)).to eq ({:stdout=>"DEVICE3\n4\n", :exit_status=>0})
    end

    it 'should return exit status of 1' do
      expect(ParallelCalabash::Runner.execute_command_for_process(3,"ruby -e 'exit(1)'",true)).to eq ({:stdout=>"", :exit_status=>1})
    end
  end

end
{'fraction_non_alphanumeric': 0.10426929392446634, 'fraction_numerical': 0.018883415435139574, 'mean_word_length': 6.104956268221574, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '3508008', 'n_tokens_mistral': 793, 'n_tokens_neox': 770, 'n_words': 163}