<commit_before>require 'test/unit'
$LOAD_PATH << File.dirname(__FILE__) + "/../lib"
require 'hudson-remote-api.rb'

class TestHudsonJob < Test::Unit::TestCase
  
  def setup
    Hudson[:url] = "http://localhost:8080"
  end
  
  def test_list
    assert Hudson::Job.list
  end
  
  def test_list_active
      assert Hudson::Job.list_active
  end
  
  def test_create
    new_job_name = 'new_test_job'
    new_job = Hudson::Job.create(new_job_name)
    assert new_job
    assert_equal(new_job.name, new_job_name)
    assert new_job.delete
  end
  
  def test_get
    job = Hudson::Job.get('test_job')
    assert job
    assert_equal 'test_job', job.name, "failed to get job name"
  end
  
  def test_desc_update
    job = Hudson::Job.new('test_job')
    assert job.description
    assert job.description = "test"
  end
  
  def test_new
    job = Hudson::Job.new('test_job')
    assert job
    assert_equal(job.name, 'test_job')
    
    new_job = Hudson::Job.new('test_job2')
    assert new_job
    assert_equal('test_job2', new_job.name)
    assert new_job.delete
  end
  
  def test_copy
    job = Hudson::Job.get('test_job')
    new_job = job.copy
    assert new_job
    assert_equal(new_job.name, 'copy_of_test_job')
    assert new_job.delete
  end

  def test_url
    job = Hudson::Job.get("test_job")
    assert_equal(job.url, "http://localhost:8080/job/#{job.name}/")
  end
end<commit_msg>adding test for url with spaces<commit_after>require 'test/unit'
$LOAD_PATH << File.dirname(__FILE__) + "/../lib"
require 'hudson-remote-api.rb'

class TestHudsonJob < Test::Unit::TestCase
  
  def setup
    Hudson[:url] = "http://localhost:8080"
  end
  
  def test_list
    assert Hudson::Job.list
  end
  
  def test_list_active
      assert Hudson::Job.list_active
  end
  
  def test_create
    new_job_name = 'new_test_job'
    new_job = Hudson::Job.create(new_job_name)
    assert new_job
    assert_equal(new_job.name, new_job_name)
    assert new_job.delete
  end
  
  def test_get
    job = Hudson::Job.get('test_job')
    assert job
    assert_equal 'test_job', job.name, "failed to get job name"
  end
  
  def test_desc_update
    job = Hudson::Job.new('test_job')
    assert job.description
    assert job.description = "test"
  end
  
  def test_new
    job = Hudson::Job.new('test_job')
    assert job
    assert_equal(job.name, 'test_job')
    
    new_job = Hudson::Job.new('test_job2')
    assert new_job
    assert_equal('test_job2', new_job.name)
    assert new_job.delete
  end
  
  def test_copy
    job = Hudson::Job.get('test_job')
    new_job = job.copy
    assert new_job
    assert_equal(new_job.name, 'copy_of_test_job')
    assert new_job.delete
  end

  def test_url
    job = Hudson::Job.get("test_job")
    assert_equal(job.url, "http://localhost:8080/job/#{job.name}/")
  end
  
  def test_job_with_spaces
    job = Hudson::Job.create('test job with spaces')
    assert job
    assert job.name
    assert job.delete
  end
end
{'fraction_non_alphanumeric': 0.1103588354773189, 'fraction_numerical': 0.006770480704129994, 'mean_word_length': 3.144460028050491, 'pattern_counts': {'":': 0, '<': 9, '<?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': '887082', 'n_tokens_mistral': 1077, 'n_tokens_neox': 1059, 'n_words': 220}