Sha256: b9b90c5cc0dba39d2081398545062042c49c0ee9d37cebb7c33bdf81ecbac9fd

Contents?: true

Size: 1.3 KB

Versions: 14

Compression:

Stored size: 1.3 KB

Contents

include Rake
include Rake::Funnel::Support

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

  describe 'defaults' do
    its(:name) { should == :version }
    its(:language) { should == :cs }
    its(:source) { should == :FromVersionFiles }
    its(:source_args) { should == {} }
    its(:target_path) { should be_an_instance_of(Proc) }
  end

  describe '#next_to_source' do
    it 'should place VersionInfo next to source' do
      expect(described_class.new.next_to_source(:cs, {}, 'blah/VERSION')).to eq('blah/VersionInfo.cs')
    end
  end

  describe 'execution' do
    let(:writer) { instance_double(AssemblyVersionWriter).as_null_object }

    before {
      allow(AssemblyVersionWriter).to receive(:new).and_return(writer)
    }

    subject {
      described_class.new(:name) do |t|
        t.language = [:cs, :vb]
        t.source = %w(one two)
        t.source_args = { foo: 42 }
        t.target_path = 'will not work'
      end
    }

    before {
      Task[subject.name].invoke
    }

    it 'should pass source and source_args' do
      expect(AssemblyVersionWriter).to have_received(:new).with(subject.source, subject.source_args)
    end

    it 'should use writer' do
      expect(writer).to have_received(:write).with(subject.target_path, subject.language)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rake-funnel-0.18.0 spec/rake/funnel/tasks/assembly_version_spec.rb
rake-funnel-0.17.0 spec/rake/funnel/tasks/assembly_version_spec.rb
rake-funnel-0.16.1 spec/rake/funnel/tasks/assembly_version_spec.rb
rake-funnel-0.16.0 spec/rake/funnel/tasks/assembly_version_spec.rb
rake-funnel-0.15.0.pre spec/rake/funnel/tasks/assembly_version_spec.rb
rake-funnel-0.14.0.pre spec/rake/funnel/tasks/assembly_version_spec.rb
rake-funnel-0.13.0.pre spec/rake/funnel/tasks/assembly_version_spec.rb
rake-funnel-0.12.0.pre spec/rake/funnel/tasks/assembly_version_spec.rb
rake-funnel-0.11.0.pre spec/rake/funnel/tasks/assembly_version_spec.rb
rake-funnel-0.10.0.pre spec/rake/funnel/tasks/assembly_version_spec.rb
rake-funnel-0.9.1.pre spec/rake/funnel/tasks/assembly_version_spec.rb
rake-funnel-0.9.0.pre spec/rake/funnel/tasks/assembly_version_spec.rb
rake-funnel-0.8.0.pre spec/rake/funnel/tasks/assembly_version_spec.rb
rake-funnel-0.7.0.pre spec/rake/funnel/tasks/assembly_version_spec.rb