Sha256: a31fc0a40e72ee4b8b8081adc465070fc3ba14a49afa1b3eb50f5ee8f2db5ad0

Contents?: true

Size: 716 Bytes

Versions: 35

Compression:

Stored size: 716 Bytes

Contents

#!/usr/bin/env rspec
require 'spec_helper'

require 'puppet/util/package'

describe Puppet::Util::Package, " versioncmp" do

  it "should be able to be used as a module function" do
    Puppet::Util::Package.should respond_to(:versioncmp)
  end

  it "should be able to sort a long set of various unordered versions" do
    ary = %w{ 1.1.6 2.3 1.1a 3.0 1.5 1 2.4 1.1-4 2.3.1 1.2 2.3.0 1.1-3 2.4b 2.4 2.40.2 2.3a.1 3.1 0002 1.1-5 1.1.a 1.06}

    newary = ary.sort { |a, b| Puppet::Util::Package.versioncmp(a,b) }

    newary.should == ["0002", "1", "1.06", "1.1-3", "1.1-4", "1.1-5", "1.1.6", "1.1.a", "1.1a", "1.2", "1.5", "2.3", "2.3.0", "2.3.1", "2.3a.1", "2.4", "2.4", "2.4b", "2.40.2", "3.0", "3.1"]
  end

end

Version data entries

35 entries across 35 versions & 3 rubygems

Version Path
supply_drop-0.9.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/util/package_spec.rb
supply_drop-0.8.1 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/util/package_spec.rb
supply_drop-0.8.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/util/package_spec.rb
puppet-2.7.12 spec/unit/util/package_spec.rb
puppet-2.7.11 spec/unit/util/package_spec.rb
supply_drop-0.7.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/util/package_spec.rb
supply_drop-0.6.1 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/util/package_spec.rb
supply_drop-0.6.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/util/package_spec.rb
puppet-2.7.9 spec/unit/util/package_spec.rb
puppet-2.7.8 spec/unit/util/package_spec.rb
puppet-2.7.6 spec/unit/util/package_spec.rb
puppet-2.7.5 spec/unit/util/package_spec.rb
puppet-2.7.4 spec/unit/util/package_spec.rb
puppet-2.7.3 spec/unit/util/package_spec.rb
puppet-2.7.1 spec/unit/util/package_spec.rb