Package limelight.commands

Source Code of limelight.commands.UnpackCommandTest

//- Copyright © 2008-2011 8th Light, Inc. All Rights Reserved.
//- Limelight and all included source files are distributed under terms of the MIT License.

package limelight.commands;

import limelight.Context;
import limelight.io.MockPacker;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

public class UnpackCommandTest
{
  private UnpackCommand command;
  private MockPacker packer;

  @Before
  public void setUp() throws Exception
  {
    command = new UnpackCommand();
    packer = new MockPacker();
    command.setPacker(packer);
  }

  @Test
  public void argumentsAreNotNull() throws Exception
  {
    assertNotNull(command.getArguments());
  }

  @Test
  public void unpacking() throws Exception
  {
    command.execute("/path/to/blah.llp");

    assertEquals("/path/to/blah.llp", packer.unpackPackagePath);
    assertEquals(Context.fs().workingDir(), packer.unpackDestination);
  }

  @Test
  public void unpackingWithOptionalDestination() throws Exception
  {
    command.execute("/path/to/blah.llp", "-d", "/unpack/dir");

    assertEquals("/path/to/blah.llp", packer.unpackPackagePath);
    assertEquals("/unpack/dir", packer.unpackDestination);
  }
}
TOP

Related Classes of limelight.commands.UnpackCommandTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.