<commit_before>require_relative '../../test_helper'

Client = Class.new do
  def login
    '<EMAIL>'
  end
end

class CreateRepoMock < EasyAuto::CreateRepo
  def client
    Client.new
  end
end

describe EasyAuto::CreateRepo do

  subject { CreateRepoMock.new }

  it 'gets the username from the client' do
    subject.client.login.must_equal '<EMAIL>'
  end

  it 'gets the user name correctly' do
    subject.username.must_equal 'test'
  end

  # it 'sends the right cli_send messages in #set_remote' do
  # end
end<commit_msg>test to check #set_remote in create-repo<commit_after>require_relative '../../test_helper'

Client = Class.new do
  def login
    '<EMAIL>'
  end
end

CreateRepoMock = Class.new(EasyAuto::CreateRepo) do
  def initialize mock
    @mock = mock
  end

  def git
    @mock
  end

  def client
    Client.new
  end

  def repo_name
    'test-repo'
  end
end

describe EasyAuto::CreateRepo do
  before do
    @mock = MiniTest::Mock.new
  end
  subject { CreateRepoMock.new @mock }

  it 'gets the username from the client' do
    subject.client.login.must_equal '<EMAIL>'
  end

  it 'gets the user name correctly' do
    subject.username.must_equal 'test-user'
  end

  it 'sends the right cli_send messages in #set_remote' do
    username = 'test-user'
    repo_name = 'test-repo'
    @mock.expect :perform, true, ["add -A"]
    @mock.expect :perform, true, ["commit -m 'first commit'"]
    @mock.expect :perform, true, ["remote add origin <EMAIL>:#{username}/#{repo_name}.git"]
    @mock.expect :perform, true, ["push -u origin master"]
    subject.set_remote
    @mock.verify
  end
end
{'fraction_non_alphanumeric': 0.10607940446650124, 'fraction_numerical': 0.0, 'mean_word_length': 3.222513089005236, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 8, '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': '1772835', 'n_tokens_mistral': 540, 'n_tokens_neox': 540, 'n_words': 166}