Sha256: 775388b528c002654d49489dc357017edd365fd34ad8e439bb65588d3a8f4016

Contents?: true

Size: 1.25 KB

Versions: 5

Compression:

Stored size: 1.25 KB

Contents

# encoding: UTF-8

require "spec_helper"

describe Tetra::Mvn do
  include Tetra::Mockers

  before(:each) do
    create_mock_project
    @path = create_mock_executable("mvn")
  end

  let(:instance) { Tetra::Mvn.new(".", mock_executable_path("mvn")) }

  after(:each) do
    delete_mock_project
  end

  describe "#get_mvn_commandline"  do
    it "returns commandline options for running maven" do
      @project.from_directory do
        commandline = instance.get_mvn_commandline(["--otheroption"])
        expected_commandline = "./#{@path} -Dmaven.repo.local=./kit/m2 --settings \
./kit/m2/settings.xml --strict-checksums --otheroption"
        expect(commandline).to eq expected_commandline
      end
    end
  end

  describe "#mvn"  do
    it "runs maven" do
      @project.from_directory do
        instance.mvn(["extra-option"])
        expect(File.read("test_out").strip).to match(/extra-option$/)
      end
    end
  end

  describe "#get_effective_pom"  do
    it "runs maven to get an effective pom" do
      @project.from_directory do
        expect(instance.get_effective_pom("test.pom")).to eq "test.pom.effective"
        expect(File.read("test_out").strip).to match(/help:effective-pom -ftest.pom -Doutput=test.pom.effective$/)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tetra-0.52.0 spec/lib/mvn_spec.rb
tetra-0.51.0 spec/lib/mvn_spec.rb
tetra-0.50.0 spec/lib/mvn_spec.rb
tetra-0.49.0 spec/lib/mvn_spec.rb
tetra-0.48.0 spec/lib/mvn_spec.rb