Skip to content

Commit

Permalink
Change isNotEmpty to nonEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
pathikrit committed Jan 16, 2017
1 parent 7b175c5 commit 18c9cd5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/src/main/scala/better/files/File.scala
Expand Up @@ -728,14 +728,14 @@ class File private(val path: Path) {
def isEmpty(implicit linkOptions: File.LinkOptions = File.LinkOptions.default): Boolean = {
if (isDirectory(linkOptions)) {
children.isEmpty
} else if (isRegularFile(linkOptions)) {
} else if (isRegularFile(linkOptions)) {
toJava.length() == 0
} else {
notExists(linkOptions)
}
}

def isNotEmpty(implicit linkOptions: File.LinkOptions = File.LinkOptions.default): Boolean = {
def nonEmpty(implicit linkOptions: File.LinkOptions = File.LinkOptions.default): Boolean = {
!isEmpty(linkOptions)
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/test/scala/better/files/FileSpec.scala
Expand Up @@ -352,7 +352,7 @@ class FileSpec extends FlatSpec with BeforeAndAfterEach with Matchers {
(destination/"a"/"a1"/"t1.txt").contentAsString shouldEqual "hello world"
destination === testRoot shouldBe true
(destination/"a"/"a1"/"t1.txt").overwrite("hello")
destination !== testRoot shouldBe true
(destination !== testRoot) shouldBe true
}

it should "zip/unzip single files" in {
Expand Down

0 comments on commit 18c9cd5

Please sign in to comment.