diff --git a/.gitignore b/.gitignore index 5c65c5a3b..20c498470 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ Gemfile.lock .ruby-version .ruby-gemset .idea +*.swp +*.swo diff --git a/lib/raven/base.rb b/lib/raven/base.rb index 4d16393a6..1e6f4601e 100644 --- a/lib/raven/base.rb +++ b/lib/raven/base.rb @@ -29,6 +29,10 @@ class << self # values for all Raven configuration options. See Raven::Configuration. attr_writer :configuration + # Alias #send to preserve original method functionality. + # Must come before method definition. + alias :send_object_message :send + def context Context.current end diff --git a/spec/raven/raven_spec.rb b/spec/raven/raven_spec.rb index d1db866eb..f6089f631 100644 --- a/spec/raven/raven_spec.rb +++ b/spec/raven/raven_spec.rb @@ -99,7 +99,13 @@ def ivars(object) be_kind_of Hash end end + describe ".send_object_message" do + before do + module Raven; class << self; def foo; 'foo'; end; end; end + end - - + it "calls methods by name" do + expect(Raven.send_object_message(:foo)).to eq 'foo' + end + end end