Skip to content

Commit

Permalink
未テストの部分のテストを書いた.
Browse files Browse the repository at this point in the history
  • Loading branch information
tamada committed Feb 16, 2017
1 parent 513f7f0 commit 3a29b47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/github/kunai/entries/PathEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ public boolean isName(String name){

@Override
public String toString(){
return String.format("%s <%s>", loadFrom(), isClass()? className(): path);
return String.format("%s <%s>", loadFrom(), isClass() && className() != null? className(): path());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ public void testBasic() throws Exception{
Entry[] entries = source.stream().toArray(size -> new Entry[size]);

assertThat(entries.length, is(1));
assertThat(entries[0].endsWith(".class"), is(true));
assertThat(entries[0].loadFrom(), is(path.toUri()));
assertThat(entries[0].className(), is(nullValue()));
assertThat(entries[0].isClass(), is(true));
assertThat(entries[0].toString(), is(String.format("%s <%s>", path.toUri(), path)));
}
}

0 comments on commit 3a29b47

Please sign in to comment.