mirror of
https://github.com/google/nomulus.git
synced 2025-07-09 12:43:24 +02:00
Use TextDiffSubject to compare multi-line text (#406)
* Use TextDiffSubject to compare multi-line text It illustrates differences better. Moved TextDiffSubject.java to the common project for sharing.
This commit is contained in:
parent
f7b243e390
commit
3aad8b6aa7
23 changed files with 104 additions and 20 deletions
|
@ -15,9 +15,9 @@
|
|||
package google.registry.tools;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.testing.truth.TextDiffSubject.assertThat;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.io.Files;
|
||||
import com.google.common.io.Resources;
|
||||
import google.registry.persistence.NomulusPostgreSql;
|
||||
|
@ -93,9 +93,7 @@ public class GenerateSqlSchemaCommandTest extends CommandTestCase<GenerateSqlSch
|
|||
public void validateGeneratedSchemaIsSameAsSchemaInFile() throws Exception {
|
||||
runCommand(
|
||||
"--start_postgresql", "--out_file=" + tmp.getRoot() + File.separatorChar + "schema.sql");
|
||||
assertThat(Files.readLines(new File(tmp.getRoot(), "schema.sql"), Charsets.UTF_8))
|
||||
.isEqualTo(
|
||||
Resources.readLines(
|
||||
Resources.getResource("sql/schema/db-schema.sql.generated"), Charsets.UTF_8));
|
||||
assertThat(new File(tmp.getRoot(), "schema.sql").toURI().toURL())
|
||||
.hasSameContentAs(Resources.getResource("sql/schema/db-schema.sql.generated"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue