Sha256: 301ac2c375ce6f2dcb39fe2910f29bec169e482c356cc050a5db0cb9e6bf53cb

Contents?: true

Size: 1.33 KB

Versions: 1

Compression:

Stored size: 1.33 KB

Contents

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

describe MavenHelperScript::ConfigurationChecker do
  before(:each) do
    @checker = MavenHelperScript::ConfigurationChecker.new(File.join(File.dirname(__FILE__)), 'map.yml')
  end

  it "should find module by mapping" do
    expect(@checker.checkForModule("p")).to eq "parent"
  end

  it "should send back mapping name when no module found, assume that is the correct module name" do
    expect(@checker.checkForModule("boo")).to eq "boo"
  end

  it "should find command using first characters when not a plugin execution" do
    expect(@checker.checkForCommand("ci")).to eq "clean install"
  end

  it "should blow up if you can't find the other part of a command" do
    expect {@checker.checkForCommand("cj") }.to raise_error(MavenHelperScript::InvalidCommandException)
  end

  it "should find plugin execution" do
    expect(@checker.checkForCommand("jr")).to eq "jetty:run"
  end

  it "should blow up when can't find command" do
    expect {@checker.checkForCommand("j") }.to raise_error(MavenHelperScript::InvalidCommandException)
  end

  it  "should return all command arguments" do
    args = Array['-ff', '-DskipTests']
    expect(@checker.checkForArguments()).to eq args
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

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