Anyone's using BDD in Powershell? - powershell

I've found a lot of threads around this question here at stackoverflow. They are 2 years old now. So I would like to know if someone is using scottmuc functions to perform a BDD in powershell. It seems very powerful at first sight.
What's your opinion about? Somebody knows some other well effective BDD framework? I would like something really close to rspec.
Note I need BDD not TDD (PSUnit) suggestions/indications.
No many using BDD on powershell then, seen the answers :). Does it mean that BDD is not useful at all, only because powershell is just scripting? I don't think it's a valid reason.
Anyway here the list up to now:
Pester, much more close to something like rspec
PowerSpec, is seems just a few should

I'm the author of Pester and happy to see that you found it! Pester was created to surround another project I did called PowerYaml (as well as the stuff #manojlds mentioned). I wanted to refactor it, but without test coverage, I didn't feel comfortable doing that. So Pester was born, and PowerYaml got refactored. It might be a decent example to show a real world situation where it is useful.
Secondly, I've just recently published a blog post that my shed some light on how to use Pester and it's workflow.
Hope this helps. If you have feature requests, please submit them to the github project.

We are using Pester in our project. It serves our purpose and we are trying to improve upon it. And yeah, the author is my colleague and wrote it for the project.
There is also PowerSpec - https://github.com/shishkin/PowerSpec ( though the description says it is aimed at TDD with Powershell )

Related

Can XCUITEST can implement the cucumber Feature files

Can we write the Feature files and step definitions in Swift Automation framework using XCUITEST Framework ?Is yes , Any jar files or plugins we need to install ?
I am unable to find much support in this
While this is not an appropriate question for StackOverflow, I will oblige you an answer with Cucumberish. I have used it in the past, it works, but I generally steer clear of third party frameworks as they add a layer of complexity and leave you in the lurch if they lose support.
I have worked a bit with CucumberSwift and got it to work fine, reading German-language Feature files and letting me define steps in Swift using all the functionality that XCUITest provides.
However, we have not adopted this in the end but are writing Feature files in Gherkin and then write ordinary XCTestCases that we link to the Feature files by mentioning Scenario names in comments. We develop the same functionality for three platforms and it was difficult to see how BDD tooling would work across all three or how we could make it work given the resources we have. Like Mike Collins we also felt that running without the complexity of additional frameworks was an added benefit.
Having said this, CucumberSwift seems promising, perhaps check out this discussion about documentation and add to it?

Using NUnit to test script and show output

I am learning how to use NUnit to test some scripts written within asp.net in c#. Does anyone know how to tell if the script has pass/failed on NUnit, as in what the test result output is.
Or does anyone know any good websites, where I can read up on learning how to use NUnit?
http://www.nunit.org/index.php?p=quickStart&r=2.4
http://nunitasp.sourceforge.net/tutorial/index.html
Lots of more links c/o Google. Your question does not enough information - 'scripts written within asp.net' is very vague.
When using VS with NUnit, you need to open your Test Explorer window. In there, you'll see a pass/fail for tests as well as output.

Versioned cloud-based social code snippet management

It seems a lot to ask, but I'm looking for a cloud-based solution to managing code snippets. I am looking for:
Tags
User accounts (I want to be able to see all of my snippets on a single page)
syntax highlighting
versioning - myself or others should be able to edit my snippets to improve them and have revisions save so that I can go back and use an older version if I prefer.
straightforward UI with minimal advertising if any
Does anyone know of a solution which meets these requirements? If not, would anyone be interested in something like this? As a software engineer, after step zero (does it already exist), I'm perfectly willing to go onto step 1 (would other people use it? If so, make it).
www.codebarrel.com
it has everything you asked for
Sounds like Gist.
http://gist.github.com/
Except for the tags part. But it might be workable anyway.
I'm working on a site for this. The very rough (as in: barely works, but not even functional yet) initial version is here: https://github.com/jasongrout/snippets

Using Powershell to Generate Report of C# Classes versus Methods and Properties

Has anyone used Powershell to generate a report of C# classes versus methods and properties? I'll admit up front I'm not attempting first to write this myself, but someone out there has probably already done it, or would highly enjoy doing it. The challenge will be recognizing things like method signatures across multiple lines. You could join the string array returned by gc and search on that to make it easier. If no one answers, I'll eventually post a solution, but probably many weeks from now.
Update: I'm looking for a Powershell solution because that's already my main scripting language, and I'd like to be able to make changes over time, perhaps extend it to cover JavaScript for example, or change the report format, and I'd like it to work with any version of Visual Studio and C#. I'm also looking for a text report, nothing graphical, so that it's more searchable and manipulatable. I like simple fully programmable free things that impose no limits. :)
Thanks,
Mike
I'm sure you can access Reflection through PowerShell.
You should also look into NDepend, which can do a lot of this sort of thing.

Can you review my Perl rewrite of Cucumber?

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/
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.
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:
download and install Dist::Zilla
and its requirements (there are
many, as it's a developer only tool)
create a dist.ini file in the top
level of your package ( 'dzil new MyPackage' )
run
'dzil test', 'dzil build', and 'dzil
release',to test, (build and test),
(build, test and release)
See the Dist::Zilla::Tutorial
Does Test::A8N fit your requirement?
If not there are plenty of other Test:: modules on CPAN which may do what you're after.