Creating tests for the TinyBlog tutorial

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating tests for the TinyBlog tutorial

Pharo Smalltalk Users mailing list
In TinyBlogEn-gitc55a88d.pdf on page 11 (2.7 Post Queries):


TestCase subclass: #TBPostTest
       instanceVariableNames: ''
       classVariableNames: ''
       package: 'TinyBlog-Tests'

Every time I save this new class, it ends up in the TinyBlog package, not TinyBlog-Tests.

I see that many other packages have *-Tests packages where their tests live.

It seems to test OK so it’s not a stopper for me, but I get an error:
“Test class not in a package with name ending with ‘-Tests’"

I’d like to understand.


I’m running:

Pharo8.0.0
build: 1124, commit: 0932da8

On MacOS 11.3.1. M1 MbPro

Reply | Threaded
Open this post in threaded view
|

Re: Creating tests for the TinyBlog tutorial

Sebastian Jordan
When you already have a package with a name "XXX" and you create a new class with its package name as "XXX-YYY", Pharo automatically detects "YYY" as a tag for the package and not as a new package. That is your problem. Your class TBPostTest is not in a package that ends with "-Tests". It is in "TinyBlog" package with the tag "Tests"

From: Michael Burns via Pharo-users <[hidden email]>
Sent: 24 May 2021 18:00
To: [hidden email] <[hidden email]>
Cc: Michael and Mary Burns <[hidden email]>
Subject: [Pharo-users] Creating tests for the TinyBlog tutorial
 
In TinyBlogEn-gitc55a88d.pdf on page 11 (2.7 Post Queries):


TestCase subclass: #TBPostTest
       instanceVariableNames: ''
       classVariableNames: ''
       package: 'TinyBlog-Tests'

Every time I save this new class, it ends up in the TinyBlog package, not TinyBlog-Tests.

I see that many other packages have *-Tests packages where their tests live.

It seems to test OK so it’s not a stopper for me, but I get an error:
“Test class not in a package with name ending with ‘-Tests’"

I’d like to understand.


I’m running:

Pharo8.0.0
build: 1124, commit: 0932da8

On MacOS 11.3.1. M1 MbPro