From c15e1dc29cf3d0529f5217a47340be97d25b1e8c Mon Sep 17 00:00:00 2001 From: Jonathan Keam Date: Thu, 3 Nov 2016 04:07:23 -0400 Subject: [PATCH] Changed RuntimeError to NotImplementedError and updated expectation to match that. This also eliminated the rspec warning for not matching against the exception type --- lib/metric_fu/generator.rb | 2 +- spec/metric_fu/generator_spec.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/metric_fu/generator.rb b/lib/metric_fu/generator.rb index 7ad6f2609..f1c840de7 100644 --- a/lib/metric_fu/generator.rb +++ b/lib/metric_fu/generator.rb @@ -124,7 +124,7 @@ def to_h #:nodoc: end def self.not_implemented - raise <<-EOF + raise NotImplementedError.new <<-EOF Required method #{caller[0]} not implemented in #{__FILE__}. This method must be implemented by a concrete class descending from Generator. See generator class documentation for more diff --git a/spec/metric_fu/generator_spec.rb b/spec/metric_fu/generator_spec.rb index 9c02bd39e..6835ed208 100644 --- a/spec/metric_fu/generator_spec.rb +++ b/spec/metric_fu/generator_spec.rb @@ -42,19 +42,19 @@ def to_h end describe "#generate_result" do - it "should raise an error when calling #emit" do + it "should raise an error when calling #emit" do @abstract_class = MetricFu::Generator.new - expect { @abstract_class.generate_result }.to raise_error + expect { @abstract_class.generate_result }.to raise_error NotImplementedError end it "should call #analyze" do @abstract_class = MetricFu::Generator.new - expect { @abstract_class.generate_result }.to raise_error + expect { @abstract_class.generate_result }.to raise_error NotImplementedError end it "should call #to_h" do @abstract_class = MetricFu::Generator.new - expect { @abstract_class.generate_result }.to raise_error + expect { @abstract_class.generate_result }.to raise_error NotImplementedError end end