When running the tests you see something like this:
WARNING: Using the `raise_error` matcher without providing a specific error or message risks false positives, since `raise_error` will match when Ruby raises a `NoMethodError`, `NameError` or `ArgumentError`, potentially allowing the expectation to pass without even executing the method you are intending to call. Actual error raised was #<RuntimeError: Required method /Users/jonathankeam/dev/projects/metric_fu/lib/metric_fu/gene...escending
from Generator. See generator class documentation for more
information.
>. Instead consider providing a specific error class or message. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /Users/jonathankeam/dev/projects/metric_fu/spec/metric_fu/generator_spec.rb:52:in `block (3 levels) in <top (required)>'.
.WARNING: Using the `raise_error` matcher without providing a specific error or message risks false positives, since `raise_error` will match when Ruby raises a `NoMethodError`, `NameError` or `ArgumentError`, potentially allowing the expectation to pass without even executing the method you are intending to call. Actual error raised was #<RuntimeError: Required method /Users/jonathankeam/dev/projects/metric_fu/lib/metric_fu/gene...escending
from Generator. See generator class documentation for more
information.
>. Instead consider providing a specific error class or message. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /Users/jonathankeam/dev/projects/metric_fu/spec/metric_fu/generator_spec.rb:57:in `block (3 levels) in <top (required)>'.
.WARNING: Using the `raise_error` matcher without providing a specific error or message risks false positives, since `raise_error` will match when Ruby raises a `NoMethodError`, `NameError` or `ArgumentError`, potentially allowing the expectation to pass without even executing the method you are intending to call. Actual error raised was #<RuntimeError: Required method /Users/jonathankeam/dev/projects/metric_fu/lib/metric_fu/gene...escending
from Generator. See generator class documentation for more
information.
>. Instead consider providing a specific error class or message. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /Users/jonathankeam/dev/projects/metric_fu/spec/metric_fu/generator_spec.rb:47:in `block (3 levels) in <top (required)>'.
It's easy to fix though. Just have to follow what the warning says and basically just add the correct error expectation.
When running the tests you see something like this:
It's easy to fix though. Just have to follow what the warning says and basically just add the correct error expectation.