Sha256: 34e7ead57bdc9e7529e55043c8d6fc41b13b352fa87dae740fbfc13d00e65e56

Contents?: true

Size: 1.44 KB

Versions: 6

Compression:

Stored size: 1.44 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(Rake::Funnel::Tasks::SideBySideSpecsSupport::Remover).to receive(:remove)
    }

    before {
      Task[subject.name].invoke
    }

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

      it 'should use remover' do
        expect(Rake::Funnel::Tasks::SideBySideSpecsSupport::Remover).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(Rake::Funnel::Tasks::SideBySideSpecsSupport::Remover).not_to have_received(:remove)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rake-funnel-0.0.6.pre spec/rake/funnel/tasks/side_by_side_specs_spec.rb
rake-funnel-0.0.5.pre spec/rake/funnel/tasks/side_by_side_specs_spec.rb
rake-funnel-0.0.4.pre spec/rake/funnel/tasks/side_by_side_specs_spec.rb
rake-funnel-0.0.3.pre spec/rake/funnel/tasks/side_by_side_specs_spec.rb
rake-funnel-0.0.2.pre spec/rake/funnel/tasks/side_by_side_specs_spec.rb
rake-funnel-0.0.1.pre spec/rake/funnel/tasks/side_by_side_specs_spec.rb