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.

UPGRADING.md 4.4 kB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. # Upgrading to 8.0.0
  2. ## AfterConfiguration hook
  3. `AfterConfiguration` hook has been removed in 8.0.0.
  4. Use the `InstallPlugin` hook if you need the `configuration` parameter.
  5. ```ruby
  6. InstallPlugin do |configuration, registry|
  7. # configuration is an instance of Cucumber::Configuration defined in
  8. # lib/cucumber/configuration.rb
  9. #
  10. # registry is an instance of Cucumber::Glue::RegistryWrapper defined in
  11. # lib/cucumber/glue/registry_wrapper.rb
  12. end
  13. ```
  14. Use the `BeforeAll` hook if you don't need the `configuration` parameter.
  15. ```ruby
  16. BeforeAll do
  17. # snip
  18. end
  19. ```
  20. More information about hooks can be found in [features/docs/writing_support_code/hooks/README.md](./features/docs/writing_support_code/hooks/README.md).
  21. ## The wire protocol
  22. The built-in wire protocol has been removed.
  23. The wire protocol is still available by explicitly using the `cucumber-wire` gem.
  24. ### Before cucumber 8.0.0
  25. Before cucumber 8.0.0, the wire protocol was automatically installed with cucumber,
  26. and automatically activated when it had detected a `.wire` file.
  27. If you were using cucumber 7.1.0 and did not already migrate your code, you had a
  28. deprecation message.
  29. ### With cucumber 8.0.0
  30. If you are not using the wire protocol, you have nothing to do.
  31. If you already have updated your code to remove the deprecation message shown when
  32. using cucumber 7.1.0, you are already up-to-date. Nothing more has to be done.
  33. If you are still using the built-in wire protocol here the step to migrate to cucumber 8.0.0:
  34. - add the gem `cucumber-wire` to your Gemfile alongside the `cucumber` one, and install it:
  35. ```ruby
  36. # Gemfile
  37. # ...
  38. gem "cucumber"
  39. gem "cucumber-wire"
  40. # ...
  41. ```
  42. ```shell
  43. bundle install
  44. ```
  45. - add `require 'cucumber/wire'` in your support code. If you do not have support
  46. code yet, create a new one. For example `features/support/wire.rb`.
  47. ```ruby
  48. # features/support/wire.rb
  49. require 'cucumber/wire'
  50. ```
  51. ## `Cucumber::Cli::Main` former `stdin` argument
  52. The second argument of `Cucumber::Cli::Main` - which was formerly named `stdin` -
  53. has been removed.
  54. ### Before cucumber 8.0.0
  55. You would have used `Cucumber::Cli::Main` with a dummy parameter:
  56. ```ruby
  57. Cucumber::Cli::Main.new(
  58. argument_list,
  59. nil, # <-- this is a former unused `stdin` parameter
  60. @stdout,
  61. @stderr,
  62. @kernel
  63. ).execute!
  64. ```
  65. ### With cucumber 8.0.0
  66. The argument has been removed from the initializer so the dummy parameter is not
  67. required anymore:
  68. ```ruby
  69. Cucumber::Cli::Main.new(
  70. argument_list,
  71. @stdout,
  72. @stderr,
  73. @kernel
  74. ).execute!
  75. ```
  76. ## DataTable#map_column `strict` argument
  77. The `strict` argument for the `map_column` method has changed to a keyword argument.
  78. ### Before 8.0.0
  79. ```ruby
  80. table.map_column('column', false).do |value|
  81. end
  82. ```
  83. ### With cucumber 8.0.0
  84. ```ruby
  85. table.map_column('column', strict: false).do |value|
  86. end
  87. ```
  88. # Upgrading to 7.1.0
  89. ## The wire protocol
  90. Usage of built-in wire protocol with `cucumber-ruby` will be deprecated in cucumber
  91. 7.1.0, and removed in cucumber 8.0.0.
  92. The wire protocol will still be available by explicitly using the `cucumber-wire`
  93. gem.
  94. ### Before cucumber 7.1.0
  95. Before cucumber 7.1.0, the wire protocol was automatically installed with cucumber,
  96. and automatically activated when it had detected a `.wire` file.
  97. ### With cucumber 7.1.0
  98. The wire protocol will work as before, but you will notice a deprecation message.
  99. To prevent the deprecation message to be shown, add the gem `cucumber-wire` to your
  100. Gemfile alongside the `cucumber` one, and install it:
  101. ```ruby
  102. # Gemfile
  103. # ...
  104. gem "cucumber"
  105. gem "cucumber-wire"
  106. # ...
  107. ```
  108. ```shell
  109. bundle install
  110. ```
  111. And add `require 'cucumber/wire'` in your support code. If you do not have support
  112. code yet, create a new one. For example `features/support/wire.rb`.
  113. ```ruby
  114. # features/support/wire.rb
  115. require 'cucumber/wire'
  116. ```
  117. The wire protocol will be installed, and no deprecation message will be shown anymore.
  118. ## AfterConfiguration hook
  119. Usage of `AfterConfiguration` hook will be deprecated in 7.1.0.
  120. Use the new `InstallPlugin` hook if you need the `configuration` parameter.
  121. Use the new `BeforeAll` hook if you don't need the `configuration` parameter.
  122. More information about hooks can be found in [features/docs/writing_support_code/hooks/README.md](./features/docs/writing_support_code/hooks/README.md).

No Description

Contributors (1)