Sha256: cd72e94f440819b55f52b80d89e604d0d40d272a9230c1567f278365da50f256

Contents?: true

Size: 1.03 KB

Versions: 24

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

module KnapsackPro
  class TestFilesWithTestCasesComposer
    # Args:
    #   All 3 arguments have structure: [{ 'path' => 'spec/a_spec.rb', 'time_execution' => 0.0 }]
    #   time_execution is not always present (but it's not relevant here)
    #
    #   test_files - list of test files that you want to run tests for
    #   slow_test_files - list of slow test files that should be split by test cases
    #   test_file_cases - list of paths to test cases (test examples) inside of all slow test files (slow_test_files)
    # Return:
    #   Test files and test cases paths (it excludes test files that should be split by test cases (test examples))
    def self.call(test_files, slow_test_files, test_file_cases)
      slow_test_file_paths = KnapsackPro::TestFilePresenter.paths(slow_test_files)

      test_files_without_slow_test_files = test_files.reject do |test_file|
        slow_test_file_paths.include?(test_file.fetch('path'))
      end

      test_files_without_slow_test_files + test_file_cases
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
knapsack_pro-7.13.1 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-7.13.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-7.12.1 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-7.12.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-7.11.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-7.10.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-7.9.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-7.8.2 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-7.8.1 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-7.8.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-7.7.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-7.6.2 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-7.6.1 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-7.6.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-7.1.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-7.0.1 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-7.0.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-6.0.4 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-6.0.3 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-6.0.2 lib/knapsack_pro/test_files_with_test_cases_composer.rb