Sha256: 25d12a89461be38a5dfe1df034ac66367257be8c584f5430cbbe751f7c55dbd4

Contents?: true

Size: 1.08 KB

Versions: 20

Compression:

Stored size: 1.08 KB

Contents

describe KnapsackPro::Runners::MinitestRunner do
  subject { described_class.new(KnapsackPro::Adapters::MinitestAdapter) }

  it { should be_kind_of KnapsackPro::Runners::BaseRunner }

  describe '.run' do
    let(:args) { '--custom-arg' }
    let(:task_name) { 'knapsack_pro:minitest_run' }

    subject { described_class.run(args) }

    before do
      stub_const("ENV", { 'KNAPSACK_PRO_TEST_SUITE_TOKEN_MINITEST' => 'minitest-token' })
    end

    it do
      test_file_paths = ['test_fake/a_test.rb', 'test_fake/b_test.rb']
      runner = instance_double(described_class,
                               test_dir: 'test',
                               test_file_paths: test_file_paths)
      expect(described_class).to receive(:new)
      .with(KnapsackPro::Adapters::MinitestAdapter).and_return(runner)

      expect(Rake::Task.task_defined?(task_name)).to be false

      subject

      expect(Rake::Task.task_defined?(task_name)).to be true

      expect(ENV['KNAPSACK_PRO_TEST_SUITE_TOKEN']).to eq 'minitest-token'
      expect(ENV['KNAPSACK_PRO_RECORDING_ENABLED']).to eq 'true'
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
knapsack_pro-0.14.0 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.13.0 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.12.0 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.11.0 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.10.0 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.9.0 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.8.0 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.7.2 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.7.1 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.7.0 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.6.1 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.6.0 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.5.0 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.4.0 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.3.0 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.2.1 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.2.0 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.1.2 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.1.1 spec/knapsack_pro/runners/minitest_runner_spec.rb
knapsack_pro-0.1.0 spec/knapsack_pro/runners/minitest_runner_spec.rb