<commit_before>require 'rspec'
require 'xcoder'

describe Xcode::Group do 

  let(:subject) { Xcode.project('TestProject') }
  
  describe "group" do
    
    context "when a group matches the name specified" do
      
      it "should return the group" do
        subject.groups.add_group('TestGroup')
        subject.groups.group('TestGroup').should_not be_nil
      end
      
    end
    
    context "when multiple groups match the name specified" do

      it "should return all the matching groups" do
        subject.groups.add_group('TestGroup')
        subject.groups.group('TestGroup').length.should == 2
      end

    end
    
    context "when a group does not match the name specified" do

      it "should return an e" do
        subject.groups.group('UnknownGroup').should be_empty
      end
      
    end
    
  end

  describe "#supergroup" do

    it "should return the owning group" do
      
      group = subject.groups.add_group('Superman')
      group.supergroup.identifier.should == subject.groups.identifier
      
    end

  end
  
  describe "#add_group" do
    
    it "should return the group" do
      subject.groups.add_group('TestGroup').should_not be_nil
    end

    context "when adding a group within a group" do
      
      it "should successfully create the subgroup" do
        subgroup = subject.groups.add_group('GroupWithSubGroup').add_group('Group MED')

        found_subgroup = subject.groups.group('GroupWithSubGroup').first.group('Group MED').first
        subgroup.should_not be_nil
        found_subgroup.should_not be_nil
        
        subgroup.identifier.should == found_subgroup.identifier
      end
      

    end

    context "when saving to file" do

      it "should save the group to the file" do
                
                group = subject.groups.add_group 'TestGroup'
                subject.save!
                
                # TODO: load the ios project again and see the group in the root
                
                file = subject.groups.add_file 'frank.txt'
                file2 = subject.groups.add_file 'frank-webber.txt'
                # p subject.registry.object file.identifier
                
                p subject.groups.children
                
      end


    end
<commit_msg>Commented out the test that saves to file<commit_after>require 'rspec'
require 'xcoder'

describe Xcode::Group do 

  let(:subject) { Xcode.project('TestProject') }
  
  describe "group" do
    
    context "when a group matches the name specified" do
      
      it "should return the group" do
        subject.groups.add_group('TestGroup')
        subject.groups.group('TestGroup').should_not be_nil
      end
      
    end
    
    context "when multiple groups match the name specified" do

      it "should return all the matching groups" do
        subject.groups.add_group('TestGroup')
        subject.groups.group('TestGroup').length.should == 2
      end

    end
    
    context "when a group does not match the name specified" do

      it "should return an e" do
        subject.groups.group('UnknownGroup').should be_empty
      end
      
    end
    
  end

  describe "#supergroup" do

    it "should return the owning group" do
      
      group = subject.groups.add_group('Superman')
      group.supergroup.identifier.should == subject.groups.identifier
      
    end

  end
  
  describe "#add_group" do
    
    it "should return the group" do
      subject.groups.add_group('TestGroup').should_not be_nil
    end

    context "when adding a group within a group" do
      
      it "should successfully create the subgroup" do
        subgroup = subject.groups.add_group('GroupWithSubGroup').add_group('Group MED')

        found_subgroup = subject.groups.group('GroupWithSubGroup').first.group('Group MED').first
        subgroup.should_not be_nil
        found_subgroup.should_not be_nil
        
        subgroup.identifier.should == found_subgroup.identifier
      end
      

    end

    context "when saving to file" do

      it "should save the group to the file" do
                
        # group = subject.groups.add_group 'TestGroup'
        # subject.save!
        # 
        # # TODO: load the ios project again and see the group in the root
        # 
        # file = subject.groups.add_file 'frank.txt'
        # file2 = subject.groups.add_file 'frank-webber.txt'
        # # p subject.registry.object file.identifier
        # 
        # p subject.groups.children
                
      end


    end

{'fraction_non_alphanumeric': 0.07688908528501988, 'fraction_numerical': 0.0008837825894829872, 'mean_word_length': 2.0505390835579513, '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': '2052114', 'n_tokens_mistral': 1275, 'n_tokens_neox': 1222, 'n_words': 365}