<commit_before>require 'pliny/commands/generator'
require 'test_helper'

describe Pliny::Commands::Generator do
subject { Pliny::Commands::Generator.new }

  before do
    FileUtils.mkdir_p('/tmp/plinytest')
    Dir.chdir('/tmp/plinytest')
    Timecop.freeze(@t = Time.now)
  end

  after do
    FileUtils.rmdir('/tmp/plinytest')
    Timecop.return
  end

  describe '#endpoint' do
    before do
      subject.endpoint('artists')
    end

    it 'creates a new endpoint module' do
      assert File.exist?('lib/endpoints/artists.rb')
    end

    it 'creates an endpoint test' do
      assert File.exist?('spec/endpoints/artists_spec.rb')
    end

    it 'creates an endpoint acceptance test' do<commit_msg>Silence #display during test<commit_after>require 'pliny/commands/generator'
require 'pliny/commands/generator/base'
require 'test_helper'

describe Pliny::Commands::Generator do
subject { Pliny::Commands::Generator.new }

  before do
    FileUtils.mkdir_p('/tmp/plinytest')
    Dir.chdir('/tmp/plinytest')
    Timecop.freeze(@t = Time.now)

    any_instance_of(Pliny::Commands::Generator::Base) do |klass|
      stub(klass).display
    end
  end

  after do
    FileUtils.rmdir('/tmp/plinytest')
    Timecop.return
  end

  describe '#endpoint' do
    before do
      subject.endpoint('artists')
    end

    it 'creates a new endpoint module' do
      assert File.exist?('lib/endpoints/artists.rb')
    end

    it 'creates an endpoint test' do
      assert File.exist?('spec/endpoints/artists_spec.rb')
    end

    it 'creates an endpoint acceptance test' do
{'fraction_non_alphanumeric': 0.11408540471637986, 'fraction_numerical': 0.0, 'mean_word_length': 3.4101123595505616, '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': '5606453', 'n_tokens_mistral': 514, 'n_tokens_neox': 510, 'n_words': 117}