<commit_before>include GitTrend

RSpec.shared_examples_for 'since daily ranking' do
  it 'display daily ranking' do
    expect { cli.invoke(:list, [], since: since, description: false) }.to output(dummy_result_without_description).to_stdout
  end
end

RSpec.shared_examples_for 'since weekly ranking' do
  it 'display weekly ranking' do
    expect { cli.invoke(:list, [], since: since, description: false) }.to output(dummy_weekly_result).to_stdout
  end
end

RSpec.shared_examples_for 'since monthly ranking' do
  it 'display monthly ranking' do
    expect { cli.invoke(:list, [], since: since, description: false) }.to output(dummy_monthly_result).to_stdout
  end
end

RSpec.describe GitTrend::CLI do
  describe '#list' do
    let(:cli) { CLI.new }

    describe 'with -n option' do
      context 'with 3' do
        before { stub_request_get('trending') }<commit_msg>Move shared_examples to describe section<commit_after>include GitTrend
RSpec.describe GitTrend::CLI do
  shared_examples 'since daily ranking' do
    it 'display daily ranking' do
      expect { cli.invoke(:list, [], since: since, description: false) }.to output(dummy_result_without_description).to_stdout
    end
  end

  shared_examples 'since weekly ranking' do
    it 'display weekly ranking' do
      expect { cli.invoke(:list, [], since: since, description: false) }.to output(dummy_weekly_result).to_stdout
    end
  end

  shared_examples 'since monthly ranking' do
    it 'display monthly ranking' do
      expect { cli.invoke(:list, [], since: since, description: false) }.to output(dummy_monthly_result).to_stdout
    end
  end

  describe '#list' do
    let(:cli) { CLI.new }

    describe 'with -n option' do
      context 'with 3' do
        before { stub_request_get('trending') }
{'fraction_non_alphanumeric': 0.10249150622876557, 'fraction_numerical': 0.0011325028312570782, 'mean_word_length': 4.0922190201729105, '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': '4091096', 'n_tokens_mistral': 556, 'n_tokens_neox': 537, 'n_words': 166}