asdvantages of using Spec DSL in Minitest? - minitest

I am using rails default mimitesting framework. Today i see minitest-rails gem. minitest-rails is a replacement for the default Rails testing engine that enables Minitest features like the Spec DSL that Rails disables by default. But i don't really understand the concept of Spec DSL?

Use of the spec DSL is purely preference. The spec DSL was popularised by RSpec, so if you are familiar with RSpec and enjoy using it you can add a similar spec DSL to minitest.
There are no advantages to using or not using the spec DSL.

Related

What is the difference between Cucumber and QAF BDD2

What is the difference between Cucumber and QAF bdd, What are the features which QAF has which is not available in Cucumber and what are the features which are available in Cucumber and not available in QAF Bdd.
Let's first take a look at BDD2 and Gherkin syntax:
Gherkin is syntax that cucumber (and QAF as well) understands. BDD2 is superset of Gherkin syntax. That means BDD2 supports all gherkin keywords and structure and have additional provisions. Below are addition provision in BDD2 syntax:
Metadata support
Provision to have external data file for examples
Parameter support
Below scenario authored in BDD2:
#smoke #TestcaseId:12345
Scenario: A scenario is a collection of executable steps of different type
Given step represents a precondition to an event
When step represents the occurrence of the event
Then step represents the outcome of the event
See more examples of BDD2.
BDD2 looks like Gherkin and any gherkin editor can understands it as well. But it depends on runner to understand and use additional features. You can use BDD2 either with QAF or Cucumber. When using cucumber QAF-Cucumber will enable cucumber runner to get benefit of addition syntax feature.
Now let's take look on features of Cucumber and QAF.
Both are open source frameworks. Cucumber is more popular and well known while QAF is widely used by different enterprises but not as much popular as compared to cucumber.
Cucumber is dedicated for BDD implementation using Gherkin.
Where as QAF supports coded, keyword driven and BDD implementation using TestNG. QAF supports QAF BDD and advance QAF BDD2 syntax in addition to Gherkin.
Till cucumber 4, java implementation of cucumber was not thread-safe
but with cucumber-4 entire architecture of implementation get changed
and it started supporting parallel execution with thread safety.
QAF formally known as ISFW was thread safe from beginning and supports scenario level parallel execution.
Cucumber is Gherkin runner can be used with Junit, TestNG or standalone. Supports only gherkin syntax. Cucumber can run BDD2 QAF-Cucumber
QAF is Built upon TestNG and have native TestNG implementation for BDD. You can use cucumber runner by using QAF-Cucumber
Cucumber doesn't have inbuilt implementation for testing of
web,mobile, web-service. Either you need to write your own implementation or use third party framework that supports cucumber.
using cucumber for different black box testing needs.
QAF has inbuilt Web, Mobile, WebServices support with different
design concepts along with resource and test data management, integration with third party tools (like jira, ALM, QMetry, Rally etc).
Cucumber supports for different programing languages.
QAF is Java only.
Cucumber supports data-driven testing by use of Examples in gherkin
syntax.
QAF supports data-driven testing by use of Examples in Gherkin
or BDD2 syntax. It also supports External data providers and
data-provider interceptor.
Cucumber has hooks for scenario lifecyle.
QAF has support for all TestNG listeners with additional step listener. In addition to that it has support for webdriver listener, webelement listener, result updator and data-provider interceptor.
Till cucumber 4, Step implementation was required to use regular
expressions. With Cucumber 4 new way similar to QAF available to get
rid of regular expression in step definition.
QAF uses simple and easy way to provide description of step.
Cucumber have predefined Parameter Type support as method arguments. It also supports custom types. For any custom type you need to implement and configure type registry. User need to use defined parameter types in step definition.
QAF natively supports all complex types including Map, List, and any custom classes. It also has transformation support to customize parameter transformation behavior. In step description user is free to use meaningful name for parameter placeholder regardless of method argument type.
Cucumber doesn't support step definition in BDD.
QAF supports new step definition in BDD as well

Using JetBrain's MPS to create an editor plugin

Can I use MPS to create a "conventional" language plugin for IntelliJ?
It looks like MPS' core feature is the transcription from a DSL to Java. However I just want to define the DSL syntax and editor to ship it as a standalone language plugin via the JetBrain plugin repository.
I am uncertain whether that is the purpose of MPS or I have to use the Grammar-Kit to create the plugin as it is described here.
Yes, MPS allows you to create IDEA plugins, just like the Grammar-Kit does. Take the MPS route, if you need any of its core features - projectional editor, modular languages or multi-stage code generator.
Vaclav

When to do Nashorn over Java Hooks?

I have a java application that does text processing.
Nashorn could be used to add customization just like hooks. So When should I use Nashorn and when should I use hooks? (assuming language doesn't matter)
It should be possible to write your hooks assuming java lambdas. This would allow Nashorn functions or Java functions to be used for your hooks. If you direct your question to nashorn-dev with specifics you will get more specific details.

How can I enable Groovy plugin features in my eclipse plugin?

I am writing an eclipse plugin which needs to support features from the Groovy eclipse plugin.
The Groovy website talks about Groovy eclipse plugins, and Groovy compiler support within eclipse and maven, but I did not find anything similar to what I need to do here.
If I look at the list of available plugin dependencies, I see a number of them:
How can I enable some discovery mechanism or otherwise, in order to install the Groovy plugin after the installation of my plugin completes?
Which plugin can I add as dependency to achieve this? Or should I have to individually add all of them?
If you want to add single plug-ins you can easily do that in the Manifest-Editor of your plug-in. If you need to add a dependency to a feature, you need to create a feature for your own plug-in and add the additional feature dependency in the feature-Editor.
To find out which groovy plug-ins are required to add the "groovy compiler support", I suppose you must rather look at the groovy features in your installation. Usually complex features like a compiler or the like are grouped within a feature.
Add on:
I think the discovery mechanism is already integrated in p2.
I suppose these plug-ins are part of a feature. Find this feature and add that to your product.
For stability I would recommend to add the specific plug-ins to your product/feature. That way you can be sure, people are using the exact version you proposed in your implmentation.

hibernate like technology as a persistence layer for groovy?

I was wondering if there is like a persistence layer for groovy that is integrated on the ide to generate code automatically based on your database structure?
Just use Hibernate, as you would for a Java project.
Groovy can call java, and you can use the cross-compiler to compile both sources when you build your project.
The Hibernate tools will not spit out Java (so the code will be more verbose than the Groovy replacements), but as you won't need to write the code, this doesn't matter ;-)

Resources