<commit_before><commit_msg>added basic tests for syncing<commit_after>require 'sync'

#setup
pub_name = "test"
pub = Publication.new(pub_name)
path = '/home/escenic/pub/'

RSpec.describe Publication do
  describe '#template' do
    it "creates a path to templates" do
        expect(pub.template(path)).to eq "#{path}template"
    end
  end
  describe '#static' do
    it "creates a path to static directory" do
        expect(pub.static(path)).to eq "#{path}static"
    end
  end
end


RSpec.describe Remote do
  server_name = "test"
  host = "host"
  port = 22
  user = "user"
  pass = "<PASSWORD>"
  credentials = Credentials.new(user,pass)
  remote = Remote.new(server_name, host, port, credentials)

  describe '#publication_dir' do
    it 'creates a publication absolute dir on remote server' do
      expect(remote.publication_dir(pub_name)).to eq "/opt/tomcat-#{server_name}/webapps-#{pub_name}/#{pub_name}/"
    end
  end

  describe '#user' do
    it 'returns ussername on remote server' do
      expect(remote.user).to eq user
    end
  end

  describe '#password' do
    it 'returns ussername on remote server' do
      expect(remote.password).to eq pass
    end
  end
end

RSpec.describe Local do
  local = Local.new(path)
  describe '#publication_dir' do
    it 'creates a publication absolute dir on remote server' do
      expect(local.publication_dir(pub_name)).to eq "#{path}/publications/#{pub_name}/src/main/webapp/"
    end
  end
end

#TODO: Add tests for upload

{'fraction_non_alphanumeric': 0.10983827493261455, 'fraction_numerical': 0.0013477088948787063, 'mean_word_length': 3.486404833836858, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '7175028', 'n_tokens_mistral': 491, 'n_tokens_neox': 481, 'n_words': 146}