Sha256: 7fff8b3a4d0a2507163c507398f0dd7267b141fca7a19dc5b3c5b3f02f572a45
Contents?: true
Size: 1.77 KB
Versions: 14
Compression:
Stored size: 1.77 KB
Contents
describe Knapsack::Allocator do let(:test_file_pattern) { nil } let(:args) do { ci_node_total: nil, ci_node_index: nil, test_file_pattern: test_file_pattern, report: nil } end let(:report_distributor) { instance_double(Knapsack::Distributors::ReportDistributor) } let(:leftover_distributor) { instance_double(Knapsack::Distributors::LeftoverDistributor) } let(:report_tests) { ['a_spec.rb', 'b_spec.rb'] } let(:leftover_tests) { ['c_spec.rb', 'd_spec.rb'] } let(:node_tests) { report_tests + leftover_tests } let(:allocator) { described_class.new(args) } before do expect(Knapsack::Distributors::ReportDistributor).to receive(:new).with(args).and_return(report_distributor) expect(Knapsack::Distributors::LeftoverDistributor).to receive(:new).with(args).and_return(leftover_distributor) allow(report_distributor).to receive(:tests_for_current_node).and_return(report_tests) allow(leftover_distributor).to receive(:tests_for_current_node).and_return(leftover_tests) end describe '#report_node_tests' do subject { allocator.report_node_tests } it { should eql report_tests } end describe '#leftover_node_tests' do subject { allocator.leftover_node_tests } it { should eql leftover_tests } end describe '#node_tests' do subject { allocator.node_tests } it { should eql node_tests } end describe '#stringify_node_tests' do subject { allocator.stringify_node_tests } it { should eql node_tests.join(' ') } end describe '#test_dir' do let(:test_file_pattern) { "test_dir/**/*_spec.rb" } subject { allocator.test_dir } before do expect(report_distributor).to receive(:test_file_pattern).and_return(test_file_pattern) end it { should eql 'test_dir/' } end end
Version data entries
14 entries across 14 versions & 1 rubygems