Sha256: 6efaed9db79af7744a41b32ac4a094177e5623393109065a31ee3152e8c075ae

Contents?: true

Size: 1.31 KB

Versions: 88

Compression:

Stored size: 1.31 KB

Contents

describe KnapsackPro::TestFilesWithTestCasesComposer do
  let(:test_files) do
    [
      { 'path' => 'spec/a_spec.rb' },
      { 'path' => 'spec/b_spec.rb' },
      { 'path' => 'spec/c_spec.rb' },
      { 'path' => 'spec/slow_1_spec.rb' },
      { 'path' => 'spec/slow_2_spec.rb' },
    ]
  end
  let(:slow_test_files) do
    [
      { 'path' => 'spec/slow_1_spec.rb', 'time_execution' => 1.0 },
      { 'path' => 'spec/slow_2_spec.rb', 'time_execution' => 2.0 },
    ]
  end
  let(:test_file_cases) do
    [
      { 'path' => 'spec/slow_1_spec.rb[1:1]' },
      { 'path' => 'spec/slow_1_spec.rb[1:2]' },
      { 'path' => 'spec/slow_2_spec.rb[1:1:1]' },
      { 'path' => 'spec/slow_2_spec.rb[1:1:2]' },
      { 'path' => 'spec/slow_2_spec.rb[1:1:3]' },
    ]
  end

  subject { described_class.call(test_files, slow_test_files, test_file_cases) }

  it 'returns test files that are not slow and test file cases for slow test files' do
    expect(subject).to eq([
      { 'path' => 'spec/a_spec.rb' },
      { 'path' => 'spec/b_spec.rb' },
      { 'path' => 'spec/c_spec.rb' },
      { 'path' => 'spec/slow_1_spec.rb[1:1]' },
      { 'path' => 'spec/slow_1_spec.rb[1:2]' },
      { 'path' => 'spec/slow_2_spec.rb[1:1:1]' },
      { 'path' => 'spec/slow_2_spec.rb[1:1:2]' },
      { 'path' => 'spec/slow_2_spec.rb[1:1:3]' },
    ])
  end
end

Version data entries

88 entries across 88 versions & 1 rubygems

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