You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

4.0.0rc4.md 2.5 kB

2 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # Cucumber-ruby 4.0rc4 is out
  2. We're super excited to announce the latest (and, we hope, last) release candidate for Cucumber-ruby 4.
  3. This new release introduces the following changes:
  4. - a new formatter for `Cucumber::Messages`
  5. - `log` and `attach` methods for step definitions
  6. - `cucumber-compatibility-kit` compliance
  7. - some deprecations
  8. ## `message` formatter
  9. The main change for this new release is the support of the new `message` formatter, which produces all the
  10. information about the test execution in a `NDJSON` report.
  11. This new formatter can be easily used with the command:
  12. ```shell
  13. cucumber --format message
  14. ```
  15. At the moment, we provide two tools supporting this new format:
  16. - the stand-alone [`json-formatter`](https://github.com/cucumber/cucumber/tree/master/json-formatter#cucumber-json-formatter)
  17. - the new [`html-formatter`](https://github.com/cucumber/cucumber/tree/master/html-formatter#cucumber-html-formatter)
  18. This new message format is one of the most important building-blocks on which we are building the new versions of `cucumber`.
  19. ## `log` and `attach` in step definitions
  20. In order to have [a more consistent API across different implementations of Cucumber](https://github.com/cucumber/cucumber/issues/897), we have introduced two new methods usable inside step definitions:
  21. - `log(message)` logs a String which will be handled by the formatters
  22. - `attach(data, media_type)` attaches a file alongside the report
  23. ## CCK compliance
  24. This release is also the first one that complies with the [`cucumber-compatibility-kit`](https://github.com/cucumber/cucumber/tree/master/compatibility-kit#cucumber-compatibility-kit),
  25. which is a set of tests that ensures that all versions of Cucumber (Ruby, Java, Javascript ...) support the same set of features
  26. and produce the same messages.
  27. ## Deprecations
  28. The built-in JSON formatter (when running `cucumber --format=json`) is now deprecated in favor of the the message formatter used with the stand-alone [`json-formatter`](https://github.com/cucumber/cucumber/tree/master/json-formatter#cucumber-json-formatter).
  29. Attaching files to the report should be done with `attach`, and `embed` is now deprecated. The same goes with the `puts` methods, which should now be favored by `log`.
  30. This means that, when version 5.0 is out, when you use `puts` inside a step definition, this will simply output to the console, without being passed to the formatters. In the meantime, a deprecation warning will be output -- you can use `Kernel.puts` to avoid that warning.

No Description

Contributors (1)