<commit_before>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'artifact'

describe "Artifact" do
  it "should build out of a string with buildr first convention group:id:type:version" do
    artifact = Artifact.new('org/github:foo:gem:0.1')
    artifact.group.should == 'org/github'
    artifact.id.should == 'foo'
    artifact.type.should == 'gem'
    artifact.version.should == '0.1'
  end

  it "should build out of a string with buildr second convention group:id:type:classifier:version" do
    artifact = Artifact.new('org.testng:testng:jar:jdk5:5.9')
    artifact.group.should == 'org.testng'
    artifact.id.should == 'testng'
    artifact.type.should == 'jar'
    artifact.classifier.should == 'jdk5'
    artifact.version.should == '5.9'
  end

  it "as_hash should return a hash with all specs" do
    artifact = Artifact.new('g:i:t:v').to_hash.should == {:group => 'g', :id => 'i', :type => 't', :version => 'v'}
  end

  it 'conventional_path should replace dot to slash in group' do
    Artifact.new('org.github:foo:gem:0.1').conventional_path.should == 'org/github/foo/0.1/foo-0.1.gem'
  end
end<commit_msg>added 'unexpected' characterization test : Artifact should build with one wildcard<commit_after>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'artifact'

describe "Artifact" do
  it "should build out of a string with buildr first convention group:id:type:version" do
    artifact = Artifact.new('org/github:foo:gem:0.1')
    artifact.group.should == 'org/github'
    artifact.id.should == 'foo'
    artifact.type.should == 'gem'
    artifact.version.should == '0.1'
  end

  it "should build out of a string with buildr second convention group:id:type:classifier:version" do
    artifact = Artifact.new('org.testng:testng:jar:jdk5:5.9')
    artifact.group.should == 'org.testng'
    artifact.id.should == 'testng'
    artifact.type.should == 'jar'
    artifact.classifier.should == 'jdk5'
    artifact.version.should == '5.9'
  end

  it 'should build with one wildcard' do
    artifact = Artifact.new('*')
    artifact.group.should == '*'
    artifact.id.should be_nil
    artifact.type.should be_nil
    artifact.version.should be_nil   
  end

  it "as_hash should return a hash with all specs" do
    artifact = Artifact.new('g:i:t:v').to_hash.should == {:group => 'g', :id => 'i', :type => 't', :version => 'v'}
  end

  it 'conventional_path should replace dot to slash in group' do
    Artifact.new('org.github:foo:gem:0.1').conventional_path.should == 'org/github/foo/0.1/foo-0.1.gem'
  end
end
{'fraction_non_alphanumeric': 0.14551804423748546, 'fraction_numerical': 0.01241753977493209, 'mean_word_length': 3.882575757575758, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '5071875', 'n_tokens_mistral': 915, 'n_tokens_neox': 862, 'n_words': 211}