File: sort_by_version_spec.rb

package info (click to toggle)
puppet-module-extlib 7.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 420 kB
  • sloc: ruby: 1,035; sh: 15; makefile: 10
file content (15 lines) | stat: -rw-r--r-- 498 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

require 'spec_helper'

describe 'extlib::sort_by_version' do
  it { is_expected.not_to eq(nil) }
  it { is_expected.to run.with_params.and_raise_error(ArgumentError) }
  it { is_expected.to run.with_params('not_an_array').and_raise_error(ArgumentError) }

  it 'sorts versions' do
    is_expected.to run.
      with_params(['10.0.0b12', '10.0.0b3', '10.0.0a2', '9.0.10', '9.0.3']).
      and_return(['9.0.3', '9.0.10', '10.0.0a2', '10.0.0b3', '10.0.0b12'])
  end
end