Sha256: 8dcdb7b2b2f0d0fb615160f2568303f323bddbac25f3bfda930772162f642d98

Contents?: true

Size: 1.23 KB

Versions: 4

Compression:

Stored size: 1.23 KB

Contents

require 'jbundler/maven_util'
class A
  include JBundler::MavenUtil
end

describe JBundler::MavenUtil do

  subject { A.new }

  it 'should convert ruby version to maven version ranges' do
    subject.to_version.must_equal "[0,)"
    subject.to_version('!2.3.4').must_equal "(2.3.4,)"
    subject.to_version('=2.3.4').must_equal "[2.3.4,2.3.4.0.0.0.0.1)"
    subject.to_version('~>1.8.2').must_equal "[1.8.2,1.8.99999]"
    subject.to_version('~>1.8').must_equal "[1.8,1.99999]"
    subject.to_version('>1.2').must_equal "(1.2,)"
    subject.to_version('<1.2').must_equal "[0,1.2)"
    subject.to_version('>=1.2').must_equal "[1.2,)"
    subject.to_version('<=1.2').must_equal "[0,1.2]"
    subject.to_version('>=1.2', '<2.0').must_equal "[1.2,2.0)"
    subject.to_version('>=1.2', '<=2.0').must_equal "[1.2,2.0]"
    subject.to_version('>1.2', '<2.0').must_equal "(1.2,2.0)"
    subject.to_version('>1.2', '<=2.0').must_equal "(1.2,2.0]"
  end
  
  it 'should maven version and ranges as is' do
    subject.to_version('1.2.3').must_equal "1.2.3"
    subject.to_version('(1,2)').must_equal "(1,2)"
    subject.to_version('[1,2)').must_equal "[1,2)"
    subject.to_version('(1,2]').must_equal "(1,2]"
    subject.to_version('[1,2]').must_equal "[1,2]"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jbundler-0.3.0 spec/maven_util_spec.rb~
jbundler-0.2.2 spec/maven_util_spec.rb~
jbundler-0.2.1 spec/maven_util_spec.rb~
jbundler-0.2.0 spec/maven_util_spec.rb~