cky
2015-7-20 18:36:18

added an integration to this channel: https://slack.com/services/7936319506\|twitter


notjack
2015-7-20 20:07:14

@lexi.lambda: Have you worked on your BDD framework idea much? I’m really curious to see it


lexi.lambda
2015-7-20 20:19:58

notjack: I’ve implemented describe and it, which were pretty easy, but I need to implement the output printer


notjack
2015-7-20 20:36:11

@lexi.lambda: How’s writing tests in it look? I’m wondering if maybe integrating it with scribble and the @ reader would let you generate a manual-style document from the tests like scribble/lp


lexi.lambda
2015-7-20 20:39:36

notjack: I’m usually skeptical of generating docs from tests, but maybe generating examples? I’m not sure, though.


notjack
2015-7-20 20:40:28

It might also be a separate thing that could be built on top of a BDD framework instead as well.


notjack
2015-7-20 20:41:06

Does it work with rackunit at all? Like the describe/it/should wraps individual rackunit checks? Or does it implement it’s own testing system?


notjack
2015-7-20 20:41:19

wondering if I can hook up an integration testing thing I’ve been making to it


notjack
2015-7-20 20:45:56

@lexi.lambda: Have you got it on github?


lexi.lambda
2015-7-20 21:10:07

notjack: describe and it are just sugar for test-suite and test-case, except that the outermost describe block automatically runs the tests


lexi.lambda
2015-7-20 21:10:29

but no, it’s not on github yet


notjack
2015-7-20 21:10:49

@lexi.lambda: That’s great


notjack
2015-7-20 21:11:29

toss it up when you get a chance


lexi.lambda
2015-7-20 21:12:52

will do… I’m still not sure if my current solution to auto-running top-level describes will make sense, mostly because that will print two separate sets of output


notjack
2015-7-20 21:13:46

How so?


lexi.lambda
2015-7-20 21:13:48

which doesn’t work nicely at all for interspersed (module+ test …) forms


lexi.lambda
2015-7-20 21:14:00

well, somehow I need to collect all the test-suites


lexi.lambda
2015-7-20 21:14:08

and I don’t want rackunit’s default output


lexi.lambda
2015-7-20 21:14:36

I’d like to display a prettier system using the descriptions provided via describe, it, and context


lexi.lambda
2015-7-20 21:15:02

but that means I need to somehow get at all the results of the describe blocks


notjack
2015-7-20 21:15:05

like jasmine-node outputs for example?


lexi.lambda
2015-7-20 21:15:08

yeah


lexi.lambda
2015-7-20 21:15:23

and I can’t really do that all that easily without replacing #%module-begin or something like that


notjack
2015-7-20 21:15:29

I don’t recall how much support rackunit has for custom output formats and the like


lexi.lambda
2015-7-20 21:19:17

it sorta kinda does, but no way to do it globally like I want to do (which makes sense)


lexi.lambda
2015-7-20 21:19:29

I haven’t come to any conclusion about how to do it properly


notjack
2015-7-20 21:24:16

test-suites plus taking control of output ports maybe?


lexi.lambda
2015-7-20 21:24:59

well, test-suites don’t autorun


lexi.lambda
2015-7-20 21:25:06

which is sort of the point


lexi.lambda
2015-7-20 21:25:22

I need all the data from all the test suites before I start printing anything


notjack
2015-7-20 21:27:52

Hmm. What about if describe and friends made test suites, but also added a main submodule to the module they’re in that ran them?


notjack
2015-7-20 21:28:20

That way you would autorun them when running that file in drracket, but they’d be available for other modules to require and run tests from multiple modules at once


notjack
2015-7-20 21:29:22

There’s some macro to do that I recall, lift-module-end-definition or something like that, that lets you add arbitrary code to the end of whatever the current module is


notjack
2015-7-20 21:31:07

but that still doesn’t tackle the whole “collect all the defined test suites” problem for a single module, as the main module would need a list of all test suites in the module to run rather than each describe creating a single run command


notjack
2015-7-20 21:32:35

that’s tricky


lexi.lambda
2015-7-20 21:56:56

It’s definitely something I need to look into more once the basics are done


notjack
2015-7-20 21:57:45

@lexi.lambda: I got a hacky thing working where describe defines a test suite in a submodule, and a run-bdd-tests (or what have you) macro creates a main submodule that dynamic-requires everything in the test suites submodule to get a list of test suites.


notjack
2015-7-20 21:58:06

It feels rather gross though


lexi.lambda
2015-7-20 22:59:56

Hmm, can you have main submodules inside of test submodules?


cky
2015-7-20 23:09:51

.oO(That seems like a strange idea. Hmm.)


notjack
2015-7-20 23:10:12

Don’t know. Testing to see if that actually gets run


notjack
2015-7-20 23:11:42

Nope, drracket’s run button doesn’t run a main submodule inside a test submodule


notjack
2015-7-20 23:13:03

It seems like it would be a nice generalization to say “whenever a module gets instantiated, if the file it’s in is the main file being run, instantiate the main submodule inside it”


notjack
2015-7-20 23:14:19

not a lot of uses for it though


lexi.lambda
2015-7-20 23:17:08

You could probably make it work with clever uses of submodules, but it’d be pretty hacky


lexi.lambda
2015-7-20 23:17:42

I wonder who maintains rackunit


notjack
2015-7-20 23:18:25

Looks like @rmculpepper


notjack
2015-7-20 23:19:11

What exactly should the output look like when testing multiple files?


lexi.lambda
2015-7-20 23:21:18

I haven’t even really considered how to aggregate multiple files yet, especially since raco test has no concept of multi file suites


notjack
2015-7-20 23:21:45

Maybe just not even bother with that and let raco test commands break up output? Something like $ raco test mod1.rkt foo - when given a widget -- should frobnicate it (checkmark) - when given a gizmo -- should treat it like a widget (x mark) bar ... $ raco test mod2.rkt baz ... maybe?


lexi.lambda
2015-7-20 23:22:32

Yeah, I haven’t really worried about it yet


lexi.lambda
2015-7-20 23:22:52

Eventually it might be nice, but that’s not necessary for now


notjack
2015-7-20 23:23:22

Yeah


lexi.lambda
2015-7-20 23:28:31

Perhaps it would make more sense to provide simpler output when running with raco test and then provide the more complex output with a raco spec command that only works on files using rackunit/spec


lexi.lambda
2015-7-20 23:30:30

It could use the approach from scribble/srcdoc and generate submodules that can then be required to get at the information


notjack
2015-7-20 23:33:36

That would make sense. Then if you wanted more control over customizing the output at the command line you could add your own switches easily


notjack
2015-7-20 23:34:13

And some other yokel (cough: me) could add a raco literate-spec command that generates a scribble doc from the tests


tbrooke
2015-7-21 01:04:56

@tbrooke has joined the channel