Can you review my Perl rewrite of Cucumber?

拜拜、爱过 提交于 2019-12-08 19:54:30

Can you review my Perl rewrite of Cucumber?

Answer: Yes.

I've read through the github code you posted. It looks pretty good.

I'm curious about the following snippet from Parser::Parser.yp::ERROR. Why did you chose to use "and do {}" over "if( ){ }"? Style? scoping? other?

  exists $parser->YYData->{ERRMSG}
  and do {
    print $parser->YYData->{ERRMSG};
    delete $parser->YYData->{ERRMSG};
    return;
  };

I haven't used cucumber and am still trying to wrap my head around the usage model. How would someone go about verifying/running your calculator example?

If you plan to release your code to CPAN (and you should), then you'll want to bundle this git source into an installable tarball. You'll want to include one of the module installing tools: ExtUtils::MakeMaker, Module::Build, etc. I've recently started using Dist::Zilla, and am really happy with it. It got me over the activation energy of releasing my first cpan module.

20 second tour of Dist::Zilla:

  1. download and install Dist::Zilla and its requirements (there are many, as it's a developer only tool)
  2. create a dist.ini file in the top level of your package ( 'dzil new MyPackage' )
  3. run 'dzil test', 'dzil build', and 'dzil release',to test, (build and test), (build, test and release)

See the Dist::Zilla::Tutorial

You might get good help on Perlmonks. That site is geared toward this sort of post, whereas Stackoverflow is more about direct and answerable questions.

Good luck, :)

There's a rather fuller implementation of Cucumber on Perl in the form of Test::BDD::Cucumber.

draegtun

Does Test::A8N fit your requirement?

If not there are plenty of other Test:: modules on CPAN which may do what you're after.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!