Sha256: 5e6c63cc9a6cfdacadb296802e00bc9c389a68d09e4dd8ad7d08115eb6ff8434

Contents?: true

Size: 1.39 KB

Versions: 3

Compression:

Stored size: 1.39 KB

Contents

# frozen_string_literal: true

require 'tmpdir'

describe Rake::Funnel::Tasks::SideBySideSpecs do
  before do
    Rake::Task.clear
  end

  describe 'defaults' do
    its(:name) { should == :compile }
    its(:projects) { should == %w(**/*.csproj **/*.vbproj **/*.fsproj) }
    its(:references) { should == [] }
    its(:specs) { should == %w(*Specs.cs *Tests.cs) }
    its(:enabled) { should == false }
    its(:packages) { should == [] }
  end

  describe 'execution' do
    subject do
      described_class.new do |t|
        t.projects = %w(**/*.??proj)
        t.references = %w(Ref)
        t.specs = %w(*Specs.cs **/*Specs.cs)
        t.enabled = enabled
        t.packages = %w(Package)
      end
    end

    before do
      allow(Rake::Funnel::Support::SpecsRemover).to receive(:remove)
    end

    before do
      Rake::Task[subject.name].invoke
    end

    context 'enabled' do
      let(:enabled) { true }

      it 'should use remover' do
        expect(Rake::Funnel::Support::SpecsRemover).to have_received(:remove)
          .with(projects: subject.projects,
                references: subject.references,
                specs: subject.specs,
                packages: subject.packages)
      end
    end

    context 'disabled' do
      let(:enabled) { false }

      it 'should do nothing' do
        expect(Rake::Funnel::Support::SpecsRemover).not_to have_received(:remove)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rake-funnel-0.24.0 spec/rake/funnel/tasks/side_by_side_specs_spec.rb
rake-funnel-0.23.0 spec/rake/funnel/tasks/side_by_side_specs_spec.rb
rake-funnel-0.22.3 spec/rake/funnel/tasks/side_by_side_specs_spec.rb