Sha256: 9b4d20f5e9e13232d64bf3ddc3524d208c281ae6caa76c8a7d899f41f55c39eb

Contents?: true

Size: 1.17 KB

Versions: 19

Compression:

Stored size: 1.17 KB

Contents

# -*- coding: utf-8 -*-
require 'spec_helper'
require 'zlib'
require 'gemirro/versions_file'

# VersionsFile tests
module Gemirro
  describe 'VersionsFile' do
    include FakeFS::SpecHelpers

    it 'should be initialized' do
      @versions_file = VersionsFile.new([
        ['gemirro', '0.0.1'],
        ['gemirro', '0.0.2']
      ])
      expect(@versions_file.versions).to eq([
        ['gemirro', '0.0.1'],
        ['gemirro', '0.0.2']
      ])
      expect(@versions_file.versions_hash).to eq(
        'gemirro' => [
          ['gemirro', '0.0.1'],
          ['gemirro', '0.0.2']
        ]
      )
    end

    it 'should load versions file' do
      wio = StringIO.new('w')
      w_gz = Zlib::GzipWriter.new(wio)
      w_gz.write(Marshal.dump([
        ['gemirro', '0.0.1'],
        ['gemirro', '0.0.2']
      ]))
      w_gz.close

      result = VersionsFile.load(wio.string)
      expect(result).to be_a(VersionsFile)

      expect(result.versions).to eq([
        ['gemirro', '0.0.1'],
        ['gemirro', '0.0.2']
      ])
      expect(result.versions_hash).to eq(
        'gemirro' => [
          ['gemirro', '0.0.1'],
          ['gemirro', '0.0.2']
        ]
      )
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
gemirro-0.10.5 spec/gemirro/versions_file_spec.rb
gemirro-0.10.4 spec/gemirro/versions_file_spec.rb
gemirro-0.10.3 spec/gemirro/versions_file_spec.rb
gemirro-0.10.2 spec/gemirro/versions_file_spec.rb
gemirro-0.10.1 spec/gemirro/versions_file_spec.rb
gemirro-0.10.0 spec/gemirro/versions_file_spec.rb
gemirro-0.9.1 spec/gemirro/versions_file_spec.rb
gemirro-0.9.0 spec/gemirro/versions_file_spec.rb
gemirro-0.8.1 spec/gemirro/versions_file_spec.rb
gemirro-0.8.0 spec/gemirro/versions_file_spec.rb
gemirro-0.7.0 spec/gemirro/versions_file_spec.rb
gemirro-0.6.0 spec/gemirro/versions_file_spec.rb
gemirro-0.5.0 spec/gemirro/versions_file_spec.rb
gemirro-0.4.0 spec/gemirro/versions_file_spec.rb
gemirro-0.3.0 spec/gemirro/versions_file_spec.rb
gemirro-0.2.0 spec/gemirro/versions_file_spec.rb
gemirro-0.1.0 spec/gemirro/versions_file_spec.rb
gemirro-0.0.2 spec/gemirro/versions_file_spec.rb
gemirro-0.0.1 spec/gemirro/versions_file_spec.rb