Sha256: 907829cb54a2de296a3dc611777b383f7ffd47897eb2c568837b58085e059b77

Contents?: true

Size: 1.18 KB

Versions: 8

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true

RSpec.describe Mutant::Integration do

  let(:class_under_test) do
    Class.new(described_class)
  end

  let(:object) { class_under_test.new(Mutant::Config::DEFAULT) }

  describe '#setup' do
    subject { object.setup }
    it_should_behave_like 'a command method'
  end

  describe '.setup' do
    subject { described_class.setup(kernel, name) }

    let(:name)   { 'null'               }
    let(:kernel) { class_double(Kernel) }

    before do
      expect(kernel).to receive(:require)
        .with('mutant/integration/null')
    end

    it { should be(Mutant::Integration::Null) }
  end
end

RSpec.describe Mutant::Integration::Null do

  let(:object) { described_class.new(Mutant::Config::DEFAULT) }

  describe '#all_tests' do
    subject { object.all_tests }

    it { should eql([]) }

    it_should_behave_like 'an idempotent method'
  end

  describe '#call' do
    let(:tests) { instance_double(Array) }

    subject { object.call(tests) }

    it 'returns test result' do
      should eql(
        Mutant::Result::Test.new(
          output:  '',
          passed:  true,
          runtime: 0.0,
          tests:   tests
        )
      )
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mutant-0.8.24 spec/unit/mutant/integration_spec.rb
mutant-0.8.23 spec/unit/mutant/integration_spec.rb
mutant-0.8.22 spec/unit/mutant/integration_spec.rb
mutant-0.8.21 spec/unit/mutant/integration_spec.rb
mutant-0.8.20 spec/unit/mutant/integration_spec.rb
mutant-0.8.19 spec/unit/mutant/integration_spec.rb
mutant-0.8.18 spec/unit/mutant/integration_spec.rb
mutant-0.8.17 spec/unit/mutant/integration_spec.rb