Jira (FACT-2589) Fix RSpec warnings

13 views
Skip to first unread message

Gheorghe Popescu (Jira)

unread,
Apr 29, 2020, 2:47:03 AM4/29/20
to puppe...@googlegroups.com
Gheorghe Popescu created an issue
 
Facter / Task FACT-2589
Fix RSpec warnings
Issue Type: Task Task
Assignee: Unassigned
Created: 2020/04/28 11:46 PM
Priority: Normal Normal
Reporter: Gheorghe Popescu

There are some RSpec warnings that should be fixed

WARNING: Using `expect { }.not_to raise_error(SpecificErrorClass)` risks false positives, since literally any other error would cause the expectation to pass, including those raised by Ruby (e.g. NoMethodError, NameError and ArgumentError), meaning the code you are intending to test may not even get reached. Instead consider using `expect { }.not_to raise_error` or `expect { }.to raise_error(DifferentSpecificErrorClass)`. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/custom_facts/core/aggregate_spec.rb:41:in `block (3 levels) in <top (required)>'. [2020-04-29 09:43:22.564537 ] ERROR Facter - Failed to handle /tmp/foo.yaml as LegacyFacter::Util::Parser::YamlParser facts: no implicit conversion of nil into String [2020-04-29 09:43:22.566776 ] ERROR Facter - Failed to handle /tmp/foo.json as LegacyFacter::Util::Parser::JsonParser facts: no implicit conversion of nil into String WARNING: Using `expect { }.not_to raise_error(SpecificErrorClass)` risks false positives, since literally any other error would cause the expectation to pass, including those raised by Ruby (e.g. NoMethodError, NameError and ArgumentError), meaning the code you are intending to test may not even get reached. Instead consider using `expect { }.not_to raise_error` or `expect { }.to raise_error(DifferentSpecificErrorClass)`. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/custom_facts/util/resolution_spec.rb:105:in `block (3 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/current_zone_resolver_spec.rb:9:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zfs_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zfs_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zfs_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zfs_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zone_resolver_spec.rb:9:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Gheorghe Popescu (Jira)

unread,
Apr 29, 2020, 2:47:04 AM4/29/20
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
Change By: Gheorghe Popescu
{code:java}
There are some RSpec warnings that should be fixed
{noformat}
WARNING: Using `expect { }.not_to raise_error(SpecificErrorClass)` risks false positives, since literally any other error would cause the expectation to pass, including those raised by Ruby (e.g. NoMethodError, NameError and ArgumentError), meaning the code you are intending to test may not even get reached. Instead consider using `expect { }.not_to raise_error` or `expect { }.to raise_error(DifferentSpecificErrorClass)`. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/custom_facts/core/aggregate_spec.rb:41:in `block (3 levels) in <top (required)>'. [2020-04-29 09:43:22.564537 ] ERROR Facter - Failed to handle /tmp/foo.yaml as LegacyFacter::Util::Parser::YamlParser facts: no implicit conversion of nil into String [2020-04-29 09:43:22.566776 ] ERROR Facter - Failed to handle /tmp/foo.json as LegacyFacter::Util::Parser::JsonParser facts: no implicit conversion of nil into String WARNING: Using `expect { }.not_to raise_error(SpecificErrorClass)` risks false positives, since literally any other error would cause the expectation to pass, including those raised by Ruby (e.g. NoMethodError, NameError and ArgumentError), meaning the code you are intending to test may not even get reached. Instead consider using `expect { }.not_to raise_error` or `expect { }.to raise_error(DifferentSpecificErrorClass)`. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/custom_facts/util/resolution_spec.rb:105:in `block (3 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/current_zone_resolver_spec.rb:9:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zfs_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zfs_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zfs_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zfs_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zone_resolver_spec.rb:9:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'.

{ noformat code }

Gheorghe Popescu (Jira)

unread,
Apr 29, 2020, 2:48:04 AM4/29/20
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
{code:java}
There are some RSpec warnings that should be fixed
WARNING: Using `expect { }.not_to raise_error(SpecificErrorClass)` risks false positives, since literally any other error would cause the expectation to pass, including those raised by Ruby (e.g. NoMethodError, NameError and ArgumentError), meaning the code you are intending to test may not even get reached. Instead consider using `expect { }.not_to raise_error` or `expect { }.to raise_error(DifferentSpecificErrorClass)`. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/custom_facts/core/aggregate_spec.rb:41:in `block (3 levels) in <top (required)>'. [2020-04-29 09:43:22.564537 ] ERROR Facter - Failed to handle /tmp/foo.yaml as LegacyFacter::Util::Parser::YamlParser facts: no implicit conversion of nil into String [2020-04-29 09:43:22.566776 ] ERROR Facter - Failed to handle /tmp/foo.json as LegacyFacter::Util::Parser::JsonParser facts: no implicit conversion of nil into String WARNING StringWARNING : Using `expect { }.not_to raise_error(SpecificErrorClass)` risks false positives, since literally any other error would cause the expectation to pass, including those raised by Ruby (e.g. NoMethodError, NameError and ArgumentError), meaning the code you are intending to test may not even get reached. Instead consider using `expect { }.not_to raise_error` or `expect { }.to raise_error(DifferentSpecificErrorClass)`. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/custom_facts/util/resolution_spec.rb:105:in `block (3 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/current_zone_resolver_spec.rb:9:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zfs_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zfs_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zfs_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zfs_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zone_resolver_spec.rb:9:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'. WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'.


{code}

Gheorghe Popescu (Jira)

unread,
Apr 29, 2020, 2:49:03 AM4/29/20
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue

{ code:java noformat }
{ code noformat }

Gheorghe Popescu (Jira)

unread,
Apr 29, 2020, 2:50:02 AM4/29/20
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
There are some warnings when running facter tests.
You can reproduce this by running `bundle exec rspec spec`

{noformat}

WARNING: Using `expect { }.not_to raise_error(SpecificErrorClass)` risks false positives, since literally any other error would cause the expectation to pass, including those raised by Ruby (e.g. NoMethodError, NameError and ArgumentError), meaning the code you are intending to test may not even get reached. Instead consider using `expect { }.not_to raise_error` or `expect { }.to raise_error(DifferentSpecificErrorClass)`. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/custom_facts/core/aggregate_spec.rb:41:in `block (3 levels) in <top (required)>'.

[2020-04-29 09:43:22.564537 ] ERROR Facter - Failed to handle /tmp/foo.yaml as LegacyFacter::Util::Parser::YamlParser facts: no implicit conversion of nil into String

[2020-04-29 09:43:22.566776 ] ERROR Facter - Failed to handle /tmp/foo.json as LegacyFacter::Util::Parser::JsonParser facts: no implicit conversion of nil into String


WARNING: Using `expect { }.not_to raise_error(SpecificErrorClass)` risks false positives, since literally any other error would cause the expectation to pass, including those raised by Ruby (e.g. NoMethodError, NameError and ArgumentError), meaning the code you are intending to test may not even get reached. Instead consider using `expect { }.not_to raise_error` or `expect { }.to raise_error(DifferentSpecificErrorClass)`. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/custom_facts/util/resolution_spec.rb:105:in `block (3 levels) in <top (required)>'.

WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/current_zone_resolver_spec.rb:9:in `block (2 levels) in <top (required)>'.

WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zfs_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'.

WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zfs_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'.

WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zfs_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'.

WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zfs_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'.

WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zone_resolver_spec.rb:9:in `block (2 levels) in <top (required)>'.

WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'.

WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'.

WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'.

WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'.

WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'.

WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead.. Called from /Users/gheorghe.popescu/Workspace/facter-ng/spec/facter/resolvers/solaris/zpool_resolver_spec.rb:6:in `block (2 levels) in <top (required)>'.

{noformat}

Gheorghe Popescu (Jira)

unread,
Apr 29, 2020, 2:59:04 AM4/29/20
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
Change By: Gheorghe Popescu
Epic Link: FACT-2123

Gheorghe Popescu (Jira)

unread,
Jun 26, 2020, 2:44:03 AM6/26/20
to puppe...@googlegroups.com
Gheorghe Popescu assigned an issue to Gheorghe Popescu
Change By: Gheorghe Popescu
Assignee: Gheorghe Popescu
Reply all
Reply to author
Forward
0 new messages