Sha256: 02cc9516fbd802058cb755878ed7ba5d84b19c4239d26fe5e551d2f309077f33

Contents?: true

Size: 964 Bytes

Versions: 1

Compression:

Stored size: 964 Bytes

Contents

$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
require "project_home_finder"

describe MavenHelperScript::ProjectHomeFinder do
  before(:each) do
    @mvnProjectFolder = File.expand_path(File.join(File.dirname(__FILE__), "..", "sample-mvn-project"))
    @finder = MavenHelperScript::ProjectHomeFinder.new()
  end

  it "should find project folder from sub folder" do
    expect(@finder.findProjectDirectory(File.join(@mvnProjectFolder, "other"))).to eq @mvnProjectFolder
    expect(@finder.findProjectDirectory(File.join(@mvnProjectFolder, "parent"))).to eq @mvnProjectFolder
  end

  it "should find project folder from project folder" do
    expect(@finder.findProjectDirectory(File.join(@mvnProjectFolder))).to eq @mvnProjectFolder
  end

  it "should blow up when can't find project folder" do
    expect { @finder.findProjectDirectory(File.join(@mvnProjectFolder, "..")) }.to raise_error(MavenHelperScript::MissingProjectFolderException)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
maven-helper-script-0.2.0 test/project_home_finder_spec.rb