Sha256: 64a5316158f2bfb58d63a2a001a80871865fee4d5efabc373a689a8b61d4093d

Contents?: true

Size: 1.87 KB

Versions: 42

Compression:

Stored size: 1.87 KB

Contents

describe KnapsackPro::Client::API::V1::BuildDistributions do
  describe '.subset' do
    let(:fixed_test_suite_split) { double }
    let(:commit_hash) { double }
    let(:branch) { double }
    let(:node_total) { double }
    let(:node_index) { double }
    let(:test_files) { double }

    subject do
      described_class.subset(
        commit_hash: commit_hash,
        branch: branch,
        node_total: node_total,
        node_index: node_index,
        test_files: test_files
      )
    end

    before do
      expect(KnapsackPro::Config::Env).to receive(:fixed_test_suite_split).and_return(fixed_test_suite_split)
    end

    it do
      action = double
      expect(KnapsackPro::Client::API::Action).to receive(:new).with({
        endpoint_path: '/v1/build_distributions/subset',
        http_method: :post,
        request_hash: {
          fixed_test_suite_split: fixed_test_suite_split,
          commit_hash: commit_hash,
          branch: branch,
          node_total: node_total,
          node_index: node_index,
          test_files: test_files
        }
      }).and_return(action)
      expect(subject).to eq action
    end
  end

  describe '.last' do
    let(:commit_hash) { double }
    let(:branch) { double }
    let(:node_total) { double }
    let(:node_index) { double }

    subject do
      described_class.last(
        commit_hash: commit_hash,
        branch: branch,
        node_total: node_total,
        node_index: node_index,
      )
    end

    it do
      action = double
      expect(KnapsackPro::Client::API::Action).to receive(:new).with({
        endpoint_path: '/v1/build_distributions/last',
        http_method: :get,
        request_hash: {
          commit_hash: commit_hash,
          branch: branch,
          node_total: node_total,
          node_index: node_index,
        }
      }).and_return(action)
      expect(subject).to eq action
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
knapsack_pro-3.5.0 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-3.4.2 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-3.4.1 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-3.4.0 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-3.3.1 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-3.3.0 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-3.2.1 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-3.2.0 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-3.1.3 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-3.1.2 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-3.1.1 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-3.1.0 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-3.0.0 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-2.18.2 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-2.18.1 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-2.18.0 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-2.17.0 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-2.16.0 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-2.15.0 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb
knapsack_pro-2.14.0 spec/knapsack_pro/client/api/v1/build_distributions_spec.rb