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-2.1.1 spec/knapsack_pro/test_files_with_test_cases_composer_spec.rb
knapsack_pro-2.1.0 spec/knapsack_pro/test_files_with_test_cases_composer_spec.rb
knapsack_pro-2.0.0 spec/knapsack_pro/test_files_with_test_cases_composer_spec.rb
knapsack_pro-1.22.3 spec/knapsack_pro/test_files_with_test_cases_composer_spec.rb
knapsack_pro-1.22.2 spec/knapsack_pro/test_files_with_test_cases_composer_spec.rb
knapsack_pro-1.22.1 spec/knapsack_pro/test_files_with_test_cases_composer_spec.rb
knapsack_pro-1.22.0 spec/knapsack_pro/test_files_with_test_cases_composer_spec.rb
knapsack_pro-1.21.0 spec/knapsack_pro/test_files_with_test_cases_composer_spec.rb