Sha256: fe4d4ab52ee893c1fbca99b14f350a1225abecc669235db3302a093757cb2068

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

require 'tmpdir'

include Rake
include Rake::Funnel::Support

describe Rake::Funnel::Tasks::SideBySideSpecs do
  before {
    Task.clear
  }

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

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

    before {
      allow(SpecsRemover).to receive(:remove)
    }

    before {
      Task[subject.name].invoke
    }

    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
              })
      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

1 entries across 1 versions & 1 rubygems

Version Path
rake-funnel-0.4.0.pre spec/rake/funnel/tasks/side_by_side_specs_spec.rb