[DRE-commits] [ruby-aruba] 79/98: Fixed offenses

Hideki Yamane henrich at moszumanska.debian.org
Tue Mar 22 12:20:43 UTC 2016


This is an automated email from the git hooks/post-receive script.

henrich pushed a commit to branch debian/sid
in repository ruby-aruba.

commit 456bfa847ccd8e2aa741de7209a3513ad4b6abbc
Author: Dennis Günnewig <dg1 at ratiodata.de>
Date:   Tue Jan 26 08:35:45 2016 +0100

    Fixed offenses
---
 lib/aruba/event_bus/name_resolver.rb | 6 ++++++
 spec/event_bus/name_resolver_spec.rb | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/aruba/event_bus/name_resolver.rb b/lib/aruba/event_bus/name_resolver.rb
index 4a035dd..fc3b23e 100644
--- a/lib/aruba/event_bus/name_resolver.rb
+++ b/lib/aruba/event_bus/name_resolver.rb
@@ -19,6 +19,8 @@ module Aruba
 
         # Thanks ActiveSupport
         # (Only needed to support Ruby 1.9.3 and JRuby)
+        # rubocop:disable Metrics/CyclomaticComplexity
+        # rubocop:disable Metrics/MethodLength
         def constantize(camel_cased_word)
           names = camel_cased_word.split('::')
 
@@ -57,6 +59,8 @@ module Aruba
             end
           end
         end
+        # rubocop:enable Metrics/CyclomaticComplexity
+        # rubocop:enable Metrics/MethodLength
       end
 
       # @private
@@ -155,7 +159,9 @@ module Aruba
       def transform(event_id)
         resolvers.find { |r| r.match? event_id }.new.transform(default_namespace, event_id)
       rescue => e
+        # rubocop:disable Metrics/LineLength
         raise EventNameResolveError, %(Transforming "#{event_id}" into an event class failed. Supported types are: #{@resolvers.map(&:supports).flatten.join(', ')}. #{e.message}.\n\n#{e.backtrace.join("\n")})
+        # rubocop:enable Metrics/LineLength
       end
     end
   end
diff --git a/spec/event_bus/name_resolver_spec.rb b/spec/event_bus/name_resolver_spec.rb
index ca971cf..6200829 100644
--- a/spec/event_bus/name_resolver_spec.rb
+++ b/spec/event_bus/name_resolver_spec.rb
@@ -62,7 +62,7 @@ describe Aruba::EventBus::NameResolver do
 
     context 'when invalid' do
       let(:original_name) { 1 }
-      it { expect { resolved_name }.to raise_error Aruba::EventNameResolveError, /Transforming "1" into an event class failed. Supported types are: Class, String, Symbol. Input type "Fixnum" of event_id "1" is invalid./ }
+      it { expect { resolved_name }.to raise_error Aruba::EventNameResolveError, /Transforming "1"/ }
     end
   end
 end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-aruba.git



More information about the Pkg-ruby-extras-commits mailing list