lundi 31 août 2015

Any way to print test case literally with Scala backticks

As we know, we can use backticks to declare a method name contains special characters, such as space, which sounds like a good way to say a unit test name. For example, we could declare a test case like this

class SampleTest {    
    @Test
    def `it should return a space` {
      ....  
    }
}

When I run this test case, I supposed to get the result

[info] Test run started
[info] Test SampleTest.it$u0020should$u0020return$u0020a$u0020space started
[info] Test run finished: 0 failed, 0 ignored, 1 total, 0.538s
[info] ScalaTest

All spaces display as $u0020. Is there any way to show spaces literally with JUnit test style?

[info] Test SampleTest.it should return a space started

I can't use Scala Spec test because I have to use JMockit in our test code.

JUnit reflects the method name it should return a space as it$u0020should$u0020return$u0020a$u0020space

Aucun commentaire:

Enregistrer un commentaire