Sha256: a96c7b5d616a82420f7937ed5ad10434427615adcd601faa5d9a78c857ba9ed8

Contents?: true

Size: 1.32 KB

Versions: 3

Compression:

Stored size: 1.32 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
    @checker.checkForModule("p").should == "parent"
  end

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

  it "should find command using first characters when not a plugin execution" do
    @checker.checkForCommand("ci").should == "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
    @checker.checkForCommand("jr").should == "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().should == args
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
maven-helper-script-0.1.6 test/configuration_checker_map_spec.rb
maven-helper-script-0.1.4 test/configuration_checker_map_spec.rb
maven-helper-script-0.1.3 test/configuration_checker_map_spec.rb