Sha256: 385f9e6aef365875ab883efe2ce9cb6dbad627c8bd86de46d95afe641fa0a61f

Contents?: true

Size: 607 Bytes

Versions: 8

Compression:

Stored size: 607 Bytes

Contents

require 'spec_helper'

describe VersionCake::VersionedResource do

  let(:resource) { described_class.new('hello/123', [1,2], [3], [4,5,6])}

  describe '#available_versions' do
    subject { resource.available_versions }

    it { is_expected.to match_array (3..6).to_a }

    context 'when given out of order' do
      let(:resource) { described_class.new('hello/123', [1,2], [3], [7,6,4,5])}

      it 'order them' do
        is_expected.to match_array (3..7).to_a
      end
    end
  end

  describe '#latest_version' do
    subject { resource.latest_version }

    it { is_expected.to eq 6 }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
versioncake-4.1.1 spec/unit/versioned_resource_spec.rb
versioncake-4.1.0 spec/unit/versioned_resource_spec.rb
versioncake-4.0.2 spec/unit/versioned_resource_spec.rb
versioncake-4.0.1 spec/unit/versioned_resource_spec.rb
versioncake-4.0.0 spec/unit/versioned_resource_spec.rb
versioncake-3.4.0 spec/unit/versioned_resource_spec.rb
versioncake-3.3.0 spec/unit/versioned_resource_spec.rb
versioncake-3.2.0 spec/unit/versioned_resource_spec.rb