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


describe Piglet::Relation do
  
  before do
    @relation = Object.new
    @relation.extend Piglet::Relation
  end
  
  it 'has a alias' do
    @relation.alias.should_not be_nil
  end
  
  it 'has a unique alias' do
    aliases = { }
    1000.times do
      @relation = Object.new
      @relation.extend Piglet::Relation
      aliases.should_not have_key(@relation.alias)
      aliases[@relation.alias] = @relation
    end
  end
  
end<commit_msg>Added a spec for Relation#group<commit_after>require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')


describe Piglet::Relation do
  
  before do
    @relation = Object.new
    @relation.extend Piglet::Relation
  end
  
  it 'has a alias' do
    @relation.alias.should_not be_nil
  end
  
  it 'has a unique alias' do
    aliases = { }
    1000.times do
      @relation = Object.new
      @relation.extend Piglet::Relation
      aliases.should_not have_key(@relation.alias)
      aliases[@relation.alias] = @relation
    end
  end
  
  describe '#group' do
    it 'returns a new relation with the relation as source' do
      @relation.group(:a).source.should == @relation
    end
  end
  
end
{'fraction_non_alphanumeric': 0.1, 'fraction_numerical': 0.0064516129032258064, 'mean_word_length': 2.8540372670807455, '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': '7632130', 'n_tokens_mistral': 417, 'n_tokens_neox': 400, 'n_words': 103}