package tests;

import static org.fest.assertions.Assertions.assertThat;

import org.fest.assertions.GenericAssert;
import org.kercoin.magrit.Configuration;
import org.kercoin.magrit.Configuration.Authentication;

public class ConfigurationAssert extends GenericAssert<ConfigurationAssert, Configuration> {

	ConfigurationAssert(Class<ConfigurationAssert> selfType,
			Configuration actual) {
		super(selfType, actual);
	}
	
	public ConfigurationAssert onPort(int expected) {
		assertThat(actual.getSshPort()).isEqualTo(expected);
		return this;
	}

	public ConfigurationAssert hasHomeDir(String absolutePath) {
		assertThat(actual.getRepositoriesHomeDir().getAbsolutePath()).isEqualTo(absolutePath);
		return this;
	}
	
	public ConfigurationAssert hasWorkDir(String absolutePath) {
		assertThat(actual.getWorkHomeDir().getAbsolutePath()).isEqualTo(absolutePath);
		return this;
	}

	public ConfigurationAssert hasPublickeyDir(String absolutePath) {
		assertThat(actual.getPublickeyRepositoryDir().getAbsolutePath()).isEqualTo(absolutePath);
		return this;
	}

	public ConfigurationAssert hasAuthentication(Authentication expected) {
		assertThat(actual.getAuthentication()).isEqualTo(expected);
		return this;
	}
	
	public ConfigurationAssert isRemoteAllowed(boolean expected) {
		assertThat(actual.isRemoteAllowed()).isEqualTo(expected);
		return this;
	}

}

@@ -67,16 +67,38 @@
 tThat;%0A%0A
+import java.io.File;%0A%0A
 import o
@@ -693,32 +693,42 @@
 th()).isEqualTo(
+cleanPath(
 absolutePath);%0A%09
@@ -716,32 +716,33 @@
 th(absolutePath)
+)
 ;%0A%09%09return this;
@@ -867,32 +867,42 @@
 th()).isEqualTo(
+cleanPath(
 absolutePath);%0A%09
@@ -890,32 +890,33 @@
 th(absolutePath)
+)
 ;%0A%09%09return this;
@@ -1064,16 +1064,26 @@
 EqualTo(
+cleanPath(
 absolute
@@ -1087,16 +1087,17 @@
 utePath)
+)
 ;%0A%09%09retu
@@ -1407,10 +1407,113 @@
 is;%0A%09%7D%0A%0A
+%09private static String cleanPath(String absolutePath) %7B%0A%09%09return new File(absolutePath).getPath();%0A%09%7D%0A%0A
 %7D%0A

Clean paths containing double /