Domanda

I need to use BEHAT (generally for PHP) against a Ruby web application. AFAIK, BEHAT is external to the application so there should be no obstacles. Still, I would appreciate some feedback, namely:

  1. Does a fundamental obstacle that would disallow the usage of BEHAT with Ruby exist?
  2. Has anyone tried it and if so, what are the obstacles experienced?
È stato utile?

Soluzione

I have not used Behat yet but from what I gather you could, fundamentally, use it to test any Web application. As long as you use Behat (or any other BDD framework for that matter) to test against a Web service in a black-box and user-acceptance fashion, you don't really care in what language your implementations is written at.

That being said, I would strongly prefer Cucumber over Behat for a Ruby application. The reason being that Cucumber provides actual ruby bindings, allowing you to write your step definitions in the same language as your implementation.

This has some obvious benefits such as reducing the learning barrier of a new developer that otherwise would have to understand both PHP and Ruby for the tests and the implementation, respectively.

Another important point is that if you wanted to follow a BDD approach on other modules, that are not necessarily responding over HTTP, a Ruby-talking framework would definitely make things much easier than a PHP-talking one.

If you are going to test a Web app solely as a black box this might not be of great importance. After all you just send HTTP requests and parse the response (headers, status code, body etc.).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top