你可以查看我的Perl重写的黄瓜吗? [英] Can you review my Perl rewrite of Cucumber?

查看:244
本文介绍了你可以查看我的Perl重写的黄瓜吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们公司有一个团队致力于接受测试X11 GUI应用程序,他们创建了一个可怕的接受测试框架,驱动GUI和运行场景。



框架是使用Perl 5编写的,并且场景文件看起来更像是非常复杂的Perl程序(具有过程式编程风格的数千行长)。



最近学习Ruby的Cucumber,并且一般都使用Ruby相当多的时间。但是不幸的是,我不能只是推动Ruby来取代Perl,因为写这些东西的人不知道Ruby,并且很肯定他们不想要这种中断。



为了使Ruby的Cucumber更接近他们的工作,我使用Perl 5重写了。不幸的是,我真的不是一个Perl程序员,并希望得到一个代码审查,并听到的建议,谁知道Perl和Cucumber。



Hi Perl / Cucumber StackOverflow用户 - 请帮助我创建这个开源尝试重新创建Perl的Cucumber!我很乐意听到您的意见并接受任何可接受的帮助。



最小的源代码在这里:

  http://github.com/kesor/p5-cucumber 

谢谢您的关注。



对于不熟悉黄瓜的人,请花一点时间看看这个小小的网页: http://cukes.info/

解决方案<你可以查看我的Perl重写
Cucumber吗?


是的。



我已阅读您发布的github代码。它看起来不错。



我很好奇从Parser :: Parser.yp :: ERROR下面的代码片段。你为什么选择使用and do {}overif(){}?样式?范围?其他?

 存在$ parser-> YYData-> {ERRMSG} 
和do {
print $ parser-> YYData-> {ERRMSG};
delete $ parser-> YYData-> {ERRMSG};
return;
};

我没有使用黄瓜,我仍然试图用我的头围绕使用模型。



如果您计划将代码发布到CPAN(您应该),那么您需要将此代码捆绑git源到一个可安装的tarball。您将需要包括一个模块安装工具:ExtUtils :: MakeMaker,Module :: Build等。我最近开始使用 Dist :: Zilla ,我真的很高兴它。



Dist:Zilla的第二次游览:


  1. 下载并安装Dist :: Zilla
    及其要求(有
    很多,因为它是仅限开发人员的工具)

  2. 在程序包的顶部
    级别创建一个dist.ini文件('dzil new MyPackage')

  3. 运行
    'dzil test','dzil build' ,以及'dzil
    release',以测试(构建和测试),
    (构建,测试和发布)


$ b b

请参阅 Dist :: Zilla ::教程


There is a team working on acceptance testing X11 GUI application in our company, and they created a monstrous acceptance testing framework that drives the GUI as well as running scenarios.

The framework is written using Perl 5, and scenario files look more like very complex Perl programs (thousands of lines long with procedural-programming style) than acceptance tests.

I recently learned Ruby's Cucumber, and generally have been using Ruby for quite a lot of time. But unfortunately I can't just shove Ruby to replace Perl because the people who are writing all of this don't know Ruby and it's quite certain that they wont want "this" kind of interruption.

So to bring Ruby's Cucumber a bit closer to their work, I rewrote it using Perl 5. Unfortunately I am really not a Perl programmer, and would love to get a code review and to hear suggestions from people who both know Perl and Cucumber.

Hi Perl/Cucumber StackOverflow users - please help me create this "open source" attempt to re-create Cucumber for Perl! I would love to hear your comments and will accept any acceptable help.

The minimal source code is here:

http://github.com/kesor/p5-cucumber

Thank you for your attention.

For those not familiar with cucumber - please take just one small moment to take a look at this one small little page: http://cukes.info/

解决方案

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

这篇关于你可以查看我的Perl重写的黄瓜吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆