Sha256: 90da6184e8f7f08404e757d6e59ea2857ad3c2fbff1158b32f0951a97e021766

Contents?: true

Size: 1.33 KB

Versions: 5

Compression:

Stored size: 1.33 KB

Contents

require 'tmpdir'

include Rake
include Rake::Funnel::Support

describe Rake::Funnel::Tasks::SideBySideSpecs do
  before do
    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(SpecsRemover).to receive(:remove)
    end

    before do
      Task[subject.name].invoke
    end

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

      it 'should use remover' do
        expect(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(SpecsRemover).not_to have_received(:remove)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rake-funnel-0.21.0 spec/rake/funnel/tasks/side_by_side_specs_spec.rb
rake-funnel-0.20.2 spec/rake/funnel/tasks/side_by_side_specs_spec.rb
rake-funnel-0.20.1 spec/rake/funnel/tasks/side_by_side_specs_spec.rb
rake-funnel-0.20.0 spec/rake/funnel/tasks/side_by_side_specs_spec.rb
rake-funnel-0.19.0 spec/rake/funnel/tasks/side_by_side_specs_spec.rb