Skip to content

Commit

Permalink
#8: Refactored method name 'write' to 'save' for Table class.
Browse files Browse the repository at this point in the history
  • Loading branch information
Georges Labrèche committed Oct 29, 2017
1 parent b30962e commit 7a1bf5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/io/frictionlessdata/tableschema/Table.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public String[] getHeaders(){
return this.dataSource.getHeaders();
}

public void write(String outputFilePath) throws Exception{
public void save(String outputFilePath) throws Exception{
this.dataSource.write(outputFilePath);
}
public List<Object[]> read(boolean cast) throws Exception{
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/io/frictionlessdata/tableschema/TableTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,12 @@ public void testReadCastData() throws Exception{
}

@Test
public void writeTable() throws Exception{
public void saveTable() throws Exception{
File createdFile = folder.newFile("test_data_table.csv");
String sourceFileAbsPath = TableTest.class.getResource("/fixtures/simple_data.csv").getPath();
Table loadedTable = new Table(sourceFileAbsPath);

loadedTable.write(createdFile.getAbsolutePath());
loadedTable.save(createdFile.getAbsolutePath());

Table readTable = new Table(createdFile.getAbsolutePath());
Assert.assertEquals(loadedTable.getHeaders()[0], "id");
Expand Down

0 comments on commit 7a1bf5d

Please sign in to comment.