1414# limitations under the License.
1515
1616require 'spec_helper'
17- require 'java_buildpack/util /version_resolver'
17+ require 'java_buildpack/repository /version_resolver'
1818
19- module JavaBuildpack ::Util
19+ module JavaBuildpack ::Repository
2020
2121 describe VersionResolver do
2222
@@ -37,37 +37,37 @@ module JavaBuildpack::Util
3737
3838
3939 it 'resolves a wildcard major version' do
40- expect ( VersionResolver . resolve ( TokenizedVersion . new ( '+' ) , VERSIONS ) . to_s ) . to eq ( '2.0.0' )
40+ expect ( VersionResolver . resolve ( JavaBuildpack :: Util :: TokenizedVersion . new ( '+' ) , VERSIONS ) . to_s ) . to eq ( '2.0.0' )
4141 end
4242
4343 it 'resolves a wildcard minor version' do
44- expect ( VersionResolver . resolve ( TokenizedVersion . new ( '1.+' ) , VERSIONS ) . to_s ) . to eq ( '1.8.0_05' )
44+ expect ( VersionResolver . resolve ( JavaBuildpack :: Util :: TokenizedVersion . new ( '1.+' ) , VERSIONS ) . to_s ) . to eq ( '1.8.0_05' )
4545 end
4646
4747 it 'resolves a wildcard micro version' do
48- expect ( VersionResolver . resolve ( TokenizedVersion . new ( '1.6.+' ) , VERSIONS ) . to_s ) . to eq ( '1.6.1_14' )
48+ expect ( VersionResolver . resolve ( JavaBuildpack :: Util :: TokenizedVersion . new ( '1.6.+' ) , VERSIONS ) . to_s ) . to eq ( '1.6.1_14' )
4949 end
5050
5151 it 'resolves a wildcard qualifier' do
52- expect ( VersionResolver . resolve ( TokenizedVersion . new ( '1.6.0_+' ) , VERSIONS ) . to_s ) . to eq ( '1.6.0_27' )
53- expect ( VersionResolver . resolve ( TokenizedVersion . new ( '1.8.0_+' ) , VERSIONS ) . to_s ) . to eq ( '1.8.0_05' )
52+ expect ( VersionResolver . resolve ( JavaBuildpack :: Util :: TokenizedVersion . new ( '1.6.0_+' ) , VERSIONS ) . to_s ) . to eq ( '1.6.0_27' )
53+ expect ( VersionResolver . resolve ( JavaBuildpack :: Util :: TokenizedVersion . new ( '1.8.0_+' ) , VERSIONS ) . to_s ) . to eq ( '1.8.0_05' )
5454 end
5555
5656 it 'resolves a non-wildcard version' do
57- expect ( VersionResolver . resolve ( TokenizedVersion . new ( '1.6.0_26' ) , VERSIONS ) . to_s ) . to eq ( '1.6.0_26' )
58- expect ( VersionResolver . resolve ( TokenizedVersion . new ( '2.0.0' ) , VERSIONS ) . to_s ) . to eq ( '2.0.0' )
57+ expect ( VersionResolver . resolve ( JavaBuildpack :: Util :: TokenizedVersion . new ( '1.6.0_26' ) , VERSIONS ) . to_s ) . to eq ( '1.6.0_26' )
58+ expect ( VersionResolver . resolve ( JavaBuildpack :: Util :: TokenizedVersion . new ( '2.0.0' ) , VERSIONS ) . to_s ) . to eq ( '2.0.0' )
5959 end
6060
6161 it 'resolves a non-digit qualifier' do
62- expect ( VersionResolver . resolve ( TokenizedVersion . new ( '1.8.0_M-7' ) , VERSIONS ) . to_s ) . to eq ( '1.8.0_M-7' )
62+ expect ( VersionResolver . resolve ( JavaBuildpack :: Util :: TokenizedVersion . new ( '1.8.0_M-7' ) , VERSIONS ) . to_s ) . to eq ( '1.8.0_M-7' )
6363 end
6464
6565 it 'should raise an exception if no version can be resolved' do
66- expect { VersionResolver . resolve ( TokenizedVersion . new ( '2.1.0' ) , VERSIONS ) . to_s } . to raise_error
66+ expect { VersionResolver . resolve ( JavaBuildpack :: Util :: TokenizedVersion . new ( '2.1.0' ) , VERSIONS ) . to_s } . to raise_error
6767 end
6868
6969 it 'should raise an exception when a wildcard is specified in the [] collection' do
70- expect { VersionResolver . resolve ( TokenizedVersion . new ( '1.6.0_25' ) , [ '+' ] ) } . to raise_error ( /Invalid/ )
70+ expect { VersionResolver . resolve ( JavaBuildpack :: Util :: TokenizedVersion . new ( '1.6.0_25' ) , [ '+' ] ) } . to raise_error ( /Invalid/ )
7171 end
7272
7373 end
0 commit comments