Sha256: 89a83c591d8ba86d0c5844b3af6b1b030902e44b53dd5bbdd579dde4b81e7193

Contents?: true

Size: 854 Bytes

Versions: 18

Compression:

Stored size: 854 Bytes

Contents

describe Rake::Funnel::Support::BinaryVersionReader do
  def binary_version(*version_parts)
    version = version_parts.map { |p| p.to_s + "\0" }.join(".\0")
    "F\0i\0l\0e\0V\0e\0r\0s\0i\0o\0n" + "\0" * 3 + version + "\0" * 3
  end

  let(:file) { 'some assembly' }

  before {
    allow(File).to receive(:binread).with(file).and_return(contents)
  }

  describe 'version can be read' do
    let(:version) { %w(1 2 3 4) }
    let(:contents) { "binary #{binary_version(*version)} binary" }

    it 'should yield all parts' do
      expect(described_class.read_from(file).file_version).to eq(version.join('.'))
    end
  end

  describe 'version cannot be read' do
    let(:contents) { 'this does not contain a version number' }

    it 'should yield empty VersionInfo' do
      expect(described_class.read_from(file).to_h).to be_empty
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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