<commit_before>require 'spec_helper'

module European
  describe CarryAll do

    let :file do
      File.join Dir.pwd, 'spec', 'data', 'configs', 'jedcn.rb'
    end

    describe '.load_file "/path/to/a/carry-all-config.rb"' do

      it 'parses a file and returns a CarryAll' do
        result = CarryAll.load_file file
        expect(result).to be_a CarryAll
      end

    end

    describe 'an instantiated CarryAll' do

      let :carry_all do
        CarryAll.load_file file
      end

      let :projects do
        carry_all.projects
      end

      let :reveal_ck do
        projects['reveal-ck']
      end

      let :travis do
        carry_all.build_systems['travis/jedcn']
      end

      let :known_project_names do
        ['reveal-ck', 'reveal-ck-template', 'rake-to-web', 'emacs-setup']
      end

      describe '#projects' do

        it 'returns a map of European::Projects in the CarryAll' do

          expect(projects.keys).to match_array known_project_names

          carry_all.projects.values.each do |project|
            expect(project.class).to eq European::Project
          end

        end

      end

      it 'knits projects, source systems, build systems, and builds together' do
        # reveal_ck's build system has been set to travis
        expect(reveal_ck.build_system).to eq travis

        # travis has been told of reveal_ck
        expect(travis.projects.values).to include reveal_ck

        # reveal_ck has a single build
        reveal_ck_build = reveal_ck.builds['reveal-ck']
        expect(reveal_ck.builds.size).to eq 1

        # The build's name has been set
        expect(reveal_ck_build.name).to eq 'reveal-ck'
        # The build is aware of the project that it belongs to
        expect(reveal_ck_build.project).to eq reveal_ck
        # The build is aware of the build system that it belongs to
        expect(reveal_ck_build.build_system).to eq travis

        # travis knows about the build
        expect(travis.builds['reveal-ck']).to eq reveal_ck_build
        expect(reveal_ck.src_url).to eq 'https://github.com/jedcn/reveal-ck.git'
      end

    end
  end
end<commit_msg>[spec] Remove (now) duplicated "DSL" stuff from carry_all<commit_after>require 'spec_helper'

module European
  describe CarryAll do

    let :file do
      File.join Dir.pwd, 'spec', 'data', 'configs', 'jedcn.rb'
    end

    describe '.load_file "/path/to/a/carry-all-config.rb"' do

      it 'parses a file and returns a CarryAll' do
        result = CarryAll.load_file file
        expect(result).to be_a CarryAll
      end

    end

    describe 'an instantiated CarryAll' do

      let :carry_all do
        CarryAll.load_file file
      end

      it 'has #projects' do
        carry_all.should respond_to :projects
      end

      it 'has #build_systems' do
        carry_all.should respond_to :build_systems
      end

      it 'has #source_systems' do
        carry_all.should respond_to :source_systems
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.08006700167504188, 'fraction_numerical': 0.00033500837520938025, 'mean_word_length': 2.288546255506608, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '6797286', 'n_tokens_mistral': 977, 'n_tokens_neox': 931, 'n_words': 273}