TheSecretSquad / toyrobotsimulator

0 stars 0 forks source link

SRP - Captured Output regex #4

Open jamesladd opened 8 years ago

jamesladd commented 8 years ago

The ToyRobotSimulatorTest has methods to help with pattern matching and constructing a Pattern. These don't belong in the Test and should instead be in a separate class similar to how CapturingPrintStream is used. This will make the Test size smaller.

Maybe even have a Matcher that allows you to match with or without a newline and thus remove additional methods that are about matching from the Test.

TheSecretSquad commented 8 years ago

Ok :smiley_cat: :+1:

TheSecretSquad commented 8 years ago

@jamesladd Should I write tests for the "matching" code? Seems weird to write tests for something that's used to test, but what guarantees that it's working correctly and not corrupting my tests of the simulation?

Come to think of it. Instead of the CapturingPrintStream having a getter on it for the contents, couldn't I put the matching methods on CapturingPrintStream and have it just verify its own contents?

jamesladd commented 8 years ago

Yes, this is a support class like capturing stream - write a test

Sent from my Commodore 64

On 18 Oct 2015, at 12:35 PM, Pete DiSalvo notifications@github.com wrote:

@jamesladd Should I write tests for the "matching" code? Seems weird to write tests for something that's used to test, but what guarantees that it's working correctly and not corrupting my tests of the simulation?

— Reply to this email directly or view it on GitHub.

TheSecretSquad commented 8 years ago

@jamesladd Thanks!