Sha256: 5b04cfc48223f1860fc870eec015a0d03f4c8fcdd77db98f265c5fa8a78e0dd8

Contents?: true

Size: 1.43 KB

Versions: 7

Compression:

Stored size: 1.43 KB

Contents

require 'rails_helper'

describe RepoAnalyzer::ProjectConfigExtractor, repo_analyzer_extractor_helpers: true do
  describe "#extract" do
    let(:expected) do
      {
        "simplecov" => false,
        "makefile_commands" => [],
        "rubocop_rules" => []
      }
    end

    it { expect(extract).to eq(project_config_extractor: expected) }

    context "with existent config files" do
      let(:expected) do
        {
          "simplecov" => true,
          "makefile_commands" => [
            "backup-production",
            "backup-staging",
            "restore-from-production",
            "restore-from-staging",
            "services-port"
          ],
          "rubocop_rules" => [
            "AllCops",
            "Layout/ParameterAlignment",
            "Lint/StructNewOverride",
            "Metrics/BlockLength",
            "Performance",
            "Performance/RedundantBlockCall",
            "RSpec/MultipleExpectations",
            "Rails",
            "Rails/Delegate",
            "Style/ClassAndModuleChildren",
            "Style/FormatString",
            "Style/FrozenStringLiteralComment"
          ]
        }
      end

      before do
        mock_file_content("Makefile", "valid_makefile")
        mock_file_content(".rubocop.yml", "valid_rubocop_rules.yml")
        mock_file_existance("spec/simplecov_config.rb")
      end

      it { expect(extract).to eq(project_config_extractor: expected) }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
repo_analyzer-1.6.0 spec/extractors/project_config_extractor_spec.rb
repo_analyzer-1.5.0 spec/extractors/project_config_extractor_spec.rb
repo_analyzer-1.4.0 spec/extractors/project_config_extractor_spec.rb
repo_analyzer-1.3.0 spec/extractors/project_config_extractor_spec.rb
repo_analyzer-1.2.0 spec/extractors/project_config_extractor_spec.rb
repo_analyzer-1.1.0 spec/extractors/project_config_extractor_spec.rb
repo_analyzer-1.0.0 spec/extractors/project_config_extractor_spec.rb