Sha256: 1dd47ba1ab69aa04f32b231bf3f04fe7fe8935e2b09d76eced519558e80b8952

Contents?: true

Size: 1 KB

Versions: 65

Compression:

Stored size: 1 KB

Contents

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

65 entries across 65 versions & 1 rubygems

Version Path
knapsack_pro-5.5.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-5.4.1 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-5.4.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-5.3.5 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-5.3.4 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-5.3.3 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-5.3.2 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-5.3.1 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-5.3.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-5.2.1 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-5.2.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-5.1.2 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-5.1.1 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-5.1.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-5.0.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-4.1.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-4.0.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-3.11.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-3.10.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb
knapsack_pro-3.9.0 lib/knapsack_pro/test_files_with_test_cases_composer.rb