franela / goblin

Minimal and Beautiful Go testing framework
MIT License
883 stars 79 forks source link

Added interface to allow different printing styles. #34

Closed iansmith closed 10 years ago

iansmith commented 10 years ago

This change is a no-op for existing goblin users. This is only useful if you are running in a terminal that doesn't understand the ansi color codes. This matters to users of go sublime because sublime isnt a terminal so the colors and check make the output hard to read.

marcosnils commented 10 years ago

Nice change!.

I'll take a look once I get home!.

iansmith commented 10 years ago

@marcosnils Thanks.

marcosnils commented 10 years ago

Ian, i've seen the change and I have a couple of questions

1) Is it possible to update the PR with the correct indentations?. I see you use 2 spaces but everything else in goblin is coded with 4 spaces.

2) I see that in goblin.go you're initializing the TerminalFancier always. How and when is the TextFancier being used?. Can you provide a quick example?

It'd would be great to auto-detect if goblin is running under a tty and then disable colors automatically. Mocha actually does it so I think it won't be difficult to achieve.

@xetorthio what do you think?

Thanks,

Marcos.

iansmith commented 10 years ago

1) I use gofmt always for code formatting... not sure what else to tell you about the issue of spaces.

2) I've updated the code to detect a terminal (good idea!) and then pick the appropriate fancier.

marcosnils commented 10 years ago

@iansmith things look way better now.

Just one more detail before merging. Check that Travis marked this merge as unstable as it didn't pass the integration build. For what I've seen you need to add the terminal dependency into the makefile in order for the tests to run.

Please update your pull request so we can merge your changes.

Thanks,

Marcos.

marcosnils commented 10 years ago

Closed.

Please continue un #35