Sha256: c0053550155135ba86f61a3ec9130314221b9ae5cf167590c8bb5f6a4dbc9324

Contents?: true

Size: 1.66 KB

Versions: 18

Compression:

Stored size: 1.66 KB

Contents

include Rake::Funnel::Support

describe Rake::Funnel::Support::AssemblyVersion::FromVersionFiles do
  describe 'defaults' do
    its(:search_pattern) { should == %w(**/VERSION) }
    its(:metadata) { should be_nil }

    describe 'overriding defaults' do
      subject {
        described_class.new({
            search_pattern: 'search pattern',
            metadata: {},
          })
      }

      its(:search_pattern) { should == 'search pattern' }
      its(:metadata) { should == {} }
    end
  end

  describe 'enumerable' do
    it { is_expected.to be_kind_of(Enumerable) }
    it { is_expected.to respond_to(:each) }

    it 'should yield enumerator' do
      expect(subject.each).to be_kind_of(Enumerator)
    end
  end

  describe 'enumeration' do
    let(:finder) { double(Finder).as_null_object }
    let(:files) { %w(1 2) }

    before {
      allow(finder).to receive(:all_or_default).and_return(files)
      allow(Finder).to receive(:new).and_return(finder)
    }

    before {
      allow(VersionInfo).to receive(:read_version_from).and_return(*files)
    }

    before {
      allow(Rake).to receive(:rake_output_message)
    }

    subject {
      described_class.new(metadata: { pre: 'alpha', build: 42, sha: 'abc' })
    }

    it 'should yield source and version info for each file' do
      args = files.map do |file|
        {
          source: file,
          version_info: VersionInfo.parse(version: file, metadata: {
              pre: subject.metadata[:pre],
              build: subject.metadata[:build],
              sha: subject.metadata[:sha]
            })
        }
      end

      expect { |b| subject.each(&b) }.to yield_successive_args(*args)
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rake-funnel-0.18.0 spec/rake/funnel/support/assembly_version/from_version_files_spec.rb
rake-funnel-0.17.0 spec/rake/funnel/support/assembly_version/from_version_files_spec.rb
rake-funnel-0.16.1 spec/rake/funnel/support/assembly_version/from_version_files_spec.rb
rake-funnel-0.16.0 spec/rake/funnel/support/assembly_version/from_version_files_spec.rb
rake-funnel-0.15.0.pre spec/rake/funnel/support/assembly_version/from_version_files_spec.rb
rake-funnel-0.14.0.pre spec/rake/funnel/support/assembly_version/from_version_files_spec.rb
rake-funnel-0.13.0.pre spec/rake/funnel/support/assembly_version/from_version_files_spec.rb
rake-funnel-0.12.0.pre spec/rake/funnel/support/assembly_version/from_version_files_spec.rb
rake-funnel-0.11.0.pre spec/rake/funnel/support/assembly_version/from_version_files_spec.rb
rake-funnel-0.10.0.pre spec/rake/funnel/support/assembly_version/from_version_files_spec.rb
rake-funnel-0.9.1.pre spec/rake/funnel/support/assembly_version/from_version_files_spec.rb
rake-funnel-0.9.0.pre spec/rake/funnel/support/assembly_version/from_version_files_spec.rb
rake-funnel-0.8.0.pre spec/rake/funnel/support/assembly_version/from_version_files_spec.rb
rake-funnel-0.7.0.pre spec/rake/funnel/support/assembly_version/from_version_files_spec.rb
rake-funnel-0.6.1.pre spec/rake/funnel/support/assembly_version/from_version_files_spec.rb
rake-funnel-0.6.0.pre spec/rake/funnel/support/assembly_version/from_version_files_spec.rb
rake-funnel-0.5.0.pre spec/rake/funnel/support/assembly_version/from_version_files_spec.rb
rake-funnel-0.4.0.pre spec/rake/funnel/support/assembly_version/from_version_files_spec.rb