Skip to content

Lots of warnings about when running unit tests #302

Closed
@danielparks

Description

@danielparks

Describe the Bug

Running bundle exec rake spec generates lots of warnings even though the tests run successfully.

Most of the warnings are about two calls to ERB.new. The unique warnings are:

…/puppet-strings/lib/puppet-strings/markdown/table_of_contents.rb:21: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.
…/puppet-strings/lib/puppet-strings/markdown/table_of_contents.rb:21: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.
…/puppet-strings/lib/puppet-strings/markdown/base.rb:186: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.
…/puppet-strings/lib/puppet-strings/markdown/base.rb:186: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.

There are also a bunch of “errors” that don’t result in test failures. They are all identical: (Update: I split this out into #307)

[error]: Failed to parse (stdin): Syntax error at 'param1' (line: 5, column: 19)

I have tested this with Ruby 2.6.0p0 (not 2.3.0, see #301) and 3.1.2p20. In 2.6.0 the ERB warnings are not present, but the “ Failed to parse” messages are present in both.

Expected Behavior

No extra output when running unit tests.

Steps to Reproduce

Steps to reproduce the behavior:

  1. bundle exec rake spec

Environment

  • ruby 3.1.2p20
  • Current main branch (dba16ed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions