Sha256: b9ecd395344baa416b0b857952b790d5ed814794190175f9baa0e4a87b799be2

Contents?: true

Size: 869 Bytes

Versions: 4

Compression:

Stored size: 869 Bytes

Contents

require 'jbundler/classpath_file'
require 'jbundler/mavenfile'
require 'jbundler/gemfile_lock'

describe JBundler::Mavenfile do

  let(:workdir) { 'target' }
  let(:mfile) { File.join(workdir, 'tmp-mvnfile') }
  let(:mfile_lock) { mfile + ".lock"}
  subject { JBundler::Mavenfile.new(mfile) }

  before do
    Dir[File.join(workdir, "tmp*")].each { |f| FileUtils.rm_f f }
  end

  it 'generates lockfile' do
    subject.generate_lockfile(%w( a b c d e f))
    File.read(mfile_lock).must_equal <<-EOF
a
b
c
d
e
f
EOF
  end

  it 'check locked coordinate' do
    File.open(mfile_lock, 'w') do |f|
      f.write <<-EOF
a:b:pom:3
a:c:jar:1
EOF
    end
    subject.locked.must_equal ["a:b:pom:3", "a:c:jar:1"]
    subject.locked?("a:b:pom:321").must_equal true
    subject.locked?("a:b:jar:321").must_equal true
    subject.locked?("a:d:jar:432").must_equal false
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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