Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Deprecate safe_level of ERB.new in Ruby 2.6 #2525

Merged

Conversation

koic
Copy link
Contributor

@koic koic commented Feb 28, 2018

This commit fixes the following build error of ruby-head (Ruby 2.6) .

Failures:

  1) RSpec::Core::Formatters::ProgressFormatter produces the expected
  full output
     Failure/Error: @example_group_instance.instance_exec(*args, &block)

     RuntimeError:
       Warnings were generated:
       /home/travis/build/rspec/rspec-core/lib/rspec/core/configuration_options.rb:171:
       warning: Passing safe_level with the 2nd argument of ERB.new is
       deprecated. Do not use it, and specify other arguments as keyword
       arguments.
       /home/travis/build/rspec/rspec-core/lib/rspec/core/configuration_options.rb:171:
       warning: Passing trim_mode with the 3rd argument of ERB.new is
       deprecated. Use keyword argument like ERB.new(str, trim_mode:
       ...) instead.
     #
       /home/travis/build/rspec/rspec-support/lib/rspec/support/spec/stderr_splitter.rb:54:in
       `verify_no_warnings!'
     #
       /home/travis/build/rspec/rspec-support/lib/rspec/support/spec.rb:25:in
       `block (2 levels) in <top (required)>'
     # ./lib/rspec/core/example.rb:447:in `instance_exec'
     # ./lib/rspec/core/example.rb:447:in `instance_exec'
     # ./lib/rspec/core/hooks.rb:355:in `run'
     # ./lib/rspec/core/hooks.rb:507:in `block in run_owned_hooks_for'
     # ./lib/rspec/core/hooks.rb:506:in `each'
     # ./lib/rspec/core/hooks.rb:506:in `run_owned_hooks_for'
     # ./lib/rspec/core/hooks.rb:593:in `block in run_example_hooks_for'
     # ./lib/rspec/core/hooks.rb:592:in `each'
     # ./lib/rspec/core/hooks.rb:592:in `run_example_hooks_for'
     # ./lib/rspec/core/hooks.rb:463:in `run'
     # ./lib/rspec/core/example.rb:507:in `run_after_example'
     # ./lib/rspec/core/example.rb:273:in `block in run'
     # ./lib/rspec/core/example.rb:500:in `block in
       with_around_and_singleton_context_hooks'
     # ./lib/rspec/core/example.rb:457:in `block in
       with_around_example_hooks'
     # ./lib/rspec/core/hooks.rb:464:in `block in run'
     # ./lib/rspec/core/hooks.rb:604:in `block in
       run_around_example_hooks_for'
     # ./lib/rspec/core/example.rb:342:in `call'
     # ./spec/support/sandboxing.rb:16:in `block (3 levels) in
       <top (required)>'
     # ./lib/rspec/core/sandbox.rb:29:in `sandboxed'
     # ./spec/support/sandboxing.rb:7:in `block (2 levels) in
       <top (required)>'
     # ./lib/rspec/core/example.rb:447:in `instance_exec'
     # ./lib/rspec/core/example.rb:447:in `instance_exec'
     # ./lib/rspec/core/hooks.rb:373:in `execute_with'
     # ./lib/rspec/core/hooks.rb:606:in `block (2 levels) in
       run_around_example_hooks_for'
     # ./lib/rspec/core/example.rb:342:in `call'
     # ./lib/rspec/core/hooks.rb:607:in `run_around_example_hooks_for'
     # ./lib/rspec/core/hooks.rb:464:in `run'
     # ./lib/rspec/core/example.rb:457:in `with_around_example_hooks'
     # ./lib/rspec/core/example.rb:500:in
       `with_around_and_singleton_context_hooks'
     # ./lib/rspec/core/example.rb:251:in `run'
     # ./lib/rspec/core/example_group.rb:629:in `block in run_examples'
     # ./lib/rspec/core/example_group.rb:625:in `map'
     # ./lib/rspec/core/example_group.rb:625:in `run_examples'
     # ./lib/rspec/core/example_group.rb:591:in `run'
     # ./lib/rspec/core/runner.rb:116:in `block (3 levels) in run_specs'
     # ./lib/rspec/core/runner.rb:116:in `map'
     # ./lib/rspec/core/runner.rb:116:in `block (2 levels) in run_specs'
     # ./lib/rspec/core/configuration.rb:1975:in `with_suite_hooks'
     # ./lib/rspec/core/runner.rb:111:in `block in run_specs'
     # ./lib/rspec/core/reporter.rb:74:in `report'
     # ./lib/rspec/core/runner.rb:110:in `run_specs'
     # ./lib/rspec/core/runner.rb:87:in `run'
     # ./lib/rspec/core/runner.rb:71:in `run'
     # ./lib/rspec/core/runner.rb:45:in `invoke'
     # ./exe/rspec:4:in `<top (required)>'
     # script/rspec_with_simplecov:42:in `load'
     # script/rspec_with_simplecov:42:in `<main>'

https://travis-ci.org/rspec/rspec-core/jobs/346647744#L1004-L1060

The following addresses are related commits.

@koic koic force-pushed the deprecate_safe_level_of_erb_new_in_ruby_2_6 branch from 9bb356f to 6b24617 Compare February 28, 2018 12:03
This commit fixes the following build error of ruby-head (Ruby 2.6) .

```console
Failures:

  1) RSpec::Core::Formatters::ProgressFormatter produces the expected
  full output
     Failure/Error: @example_group_instance.instance_exec(*args, &block)

     RuntimeError:
       Warnings were generated:
       /home/travis/build/rspec/rspec-core/lib/rspec/core/configuration_options.rb:171:
       warning: Passing safe_level with the 2nd argument of ERB.new is
       deprecated. Do not use it, and specify other arguments as keyword
       arguments.
       /home/travis/build/rspec/rspec-core/lib/rspec/core/configuration_options.rb:171:
       warning: Passing trim_mode with the 3rd argument of ERB.new is
       deprecated. Use keyword argument like ERB.new(str, trim_mode:
       ...) instead.
     #
       /home/travis/build/rspec/rspec-support/lib/rspec/support/spec/stderr_splitter.rb:54:in
       `verify_no_warnings!'
     #
       /home/travis/build/rspec/rspec-support/lib/rspec/support/spec.rb:25:in
       `block (2 levels) in <top (required)>'
     # ./lib/rspec/core/example.rb:447:in `instance_exec'
     # ./lib/rspec/core/example.rb:447:in `instance_exec'
     # ./lib/rspec/core/hooks.rb:355:in `run'
     # ./lib/rspec/core/hooks.rb:507:in `block in run_owned_hooks_for'
     # ./lib/rspec/core/hooks.rb:506:in `each'
     # ./lib/rspec/core/hooks.rb:506:in `run_owned_hooks_for'
     # ./lib/rspec/core/hooks.rb:593:in `block in run_example_hooks_for'
     # ./lib/rspec/core/hooks.rb:592:in `each'
     # ./lib/rspec/core/hooks.rb:592:in `run_example_hooks_for'
     # ./lib/rspec/core/hooks.rb:463:in `run'
     # ./lib/rspec/core/example.rb:507:in `run_after_example'
     # ./lib/rspec/core/example.rb:273:in `block in run'
     # ./lib/rspec/core/example.rb:500:in `block in
       with_around_and_singleton_context_hooks'
     # ./lib/rspec/core/example.rb:457:in `block in
       with_around_example_hooks'
     # ./lib/rspec/core/hooks.rb:464:in `block in run'
     # ./lib/rspec/core/hooks.rb:604:in `block in
       run_around_example_hooks_for'
     # ./lib/rspec/core/example.rb:342:in `call'
     # ./spec/support/sandboxing.rb:16:in `block (3 levels) in
       <top (required)>'
     # ./lib/rspec/core/sandbox.rb:29:in `sandboxed'
     # ./spec/support/sandboxing.rb:7:in `block (2 levels) in
       <top (required)>'
     # ./lib/rspec/core/example.rb:447:in `instance_exec'
     # ./lib/rspec/core/example.rb:447:in `instance_exec'
     # ./lib/rspec/core/hooks.rb:373:in `execute_with'
     # ./lib/rspec/core/hooks.rb:606:in `block (2 levels) in
       run_around_example_hooks_for'
     # ./lib/rspec/core/example.rb:342:in `call'
     # ./lib/rspec/core/hooks.rb:607:in `run_around_example_hooks_for'
     # ./lib/rspec/core/hooks.rb:464:in `run'
     # ./lib/rspec/core/example.rb:457:in `with_around_example_hooks'
     # ./lib/rspec/core/example.rb:500:in
       `with_around_and_singleton_context_hooks'
     # ./lib/rspec/core/example.rb:251:in `run'
     # ./lib/rspec/core/example_group.rb:629:in `block in run_examples'
     # ./lib/rspec/core/example_group.rb:625:in `map'
     # ./lib/rspec/core/example_group.rb:625:in `run_examples'
     # ./lib/rspec/core/example_group.rb:591:in `run'
     # ./lib/rspec/core/runner.rb:116:in `block (3 levels) in run_specs'
     # ./lib/rspec/core/runner.rb:116:in `map'
     # ./lib/rspec/core/runner.rb:116:in `block (2 levels) in run_specs'
     # ./lib/rspec/core/configuration.rb:1975:in `with_suite_hooks'
     # ./lib/rspec/core/runner.rb:111:in `block in run_specs'
     # ./lib/rspec/core/reporter.rb:74:in `report'
     # ./lib/rspec/core/runner.rb:110:in `run_specs'
     # ./lib/rspec/core/runner.rb:87:in `run'
     # ./lib/rspec/core/runner.rb:71:in `run'
     # ./lib/rspec/core/runner.rb:45:in `invoke'
     # ./exe/rspec:4:in `<top (required)>'
     # script/rspec_with_simplecov:42:in `load'
     # script/rspec_with_simplecov:42:in `<main>'
```

https://travis-ci.org/rspec/rspec-core/jobs/346647744#L1004-L1060

The following addresses are related commits.

- ruby/ruby@cc777d0
- ruby/ruby@8b9a3ea
@koic koic force-pushed the deprecate_safe_level_of_erb_new_in_ruby_2_6 branch from 6b24617 to c1b5695 Compare February 28, 2018 12:15
@myronmarston myronmarston merged commit fafbed5 into rspec:master Mar 1, 2018
@myronmarston
Copy link
Member

Thanks!

@koic koic deleted the deprecate_safe_level_of_erb_new_in_ruby_2_6 branch March 1, 2018 06:23
MatheusRich pushed a commit to MatheusRich/rspec-core that referenced this pull request Oct 30, 2020
…ew_in_ruby_2_6

Deprecate safe_level of `ERB.new` in Ruby 2.6
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants