I have an example object:
object Foo {
private def sayFoo = \"Foo!\"
}
And I want to test the private sayFoo method without the following
It cannot be tested by any standard means.
However, if you need to "cover" that section of code, then test the methods which use that private method in their implementation. It is indirect, granted, but it does effectively test the code.
For example, in your class you could have another method:
def dontSayBar = {
sayFoo()
println("Other processing...")
}
and this will "cover" the code in the private method if tested.
P.S. A good rule of thumb is that if you see code that isn't showing up in a coverage run, then you probably don't actually need that code.