<commit_before>require 'spec_helper'

describe Repos::CLI do
  describe '#list' do
    before(:context) { create_repo_tree }

    after(:context) { FileUtils.rm_r 'dir' }

    context 'by default' do
      it 'lists all clean and dirty Git repositories in the given ' \
        'directory' do
        expect { Repos::CLI.start %w(list dir) }.to \
          output("clean dir/a_clean_repo\ndirty dir/a_dirty_repo\n")
          .to_stdout
      end
    end

    context 'with --recursive' do
      it 'lists all Git repositories in the given directory and all ' \
      'subdirectories' do
        expect { Repos::CLI.start %w(list dir --recursive) }.to \
          output("clean dir/a_clean_repo\ndirty dir/a_dirty_repo\nclean dir/repo_inside/another_repo\n").to_stdout
      end
    end

    context 'with --verbose' do
      it 'has tests'
    end

    context 'with --names' do
      it 'lists all clean and dirty Git repositories in the given ' \
        'directory' do
        expect { Repos::CLI.start %w(list dir --names) }.to \
          output("dir/a_clean_repo\ndir/a_dirty_repo\n").to_stdout
      end
    end

    context 'with --filter' do
      context 'when filter is "clean"' do<commit_msg>Add a pending spec for listing repos in the current directory<commit_after>require 'spec_helper'

describe Repos::CLI do
  describe '#list' do
    before(:context) { create_repo_tree }

    after(:context) { FileUtils.rm_r 'dir' }

    context 'by default' do
      xit 'lists all clean and dirty Git repositories in the current ' \
          'directory' do
        Dir.chdir 'dir' do
          expect { Repos::CLI.start %w(list) }.to \
            output("clean a_clean_repo\ndirty a_dirty_repo\n")
            .to_stdout
        end
      end

      it 'lists all clean and dirty Git repositories in the given ' \
        'directory' do
        expect { Repos::CLI.start %w(list dir) }.to \
          output("clean dir/a_clean_repo\ndirty dir/a_dirty_repo\n")
          .to_stdout
      end
    end

    context 'with --recursive' do
      it 'lists all Git repositories in the given directory and all ' \
      'subdirectories' do
        expect { Repos::CLI.start %w(list dir --recursive) }.to \
          output("clean dir/a_clean_repo\ndirty dir/a_dirty_repo\nclean dir/repo_inside/another_repo\n").to_stdout
      end
    end

    context 'with --verbose' do
      it 'has tests'
    end

    context 'with --names' do
      it 'lists all clean and dirty Git repositories in the given ' \
        'directory' do
        expect { Repos::CLI.start %w(list dir --names) }.to \
          output("dir/a_clean_repo\ndir/a_dirty_repo\n").to_stdout
      end
    end

    context 'with --filter' do
      context 'when filter is "clean"' do
{'fraction_non_alphanumeric': 0.1009475218658892, 'fraction_numerical': 0.0, 'mean_word_length': 2.267857142857143, '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': '6912447', 'n_tokens_mistral': 891, 'n_tokens_neox': 849, 'n_words': 263}