Commit 81478cba44472bcffd459ba21e866fdd4a1b315d
1 parent
81b33ca3
Exists in
staging
and in
42 other branches
Revert "plugins: don't crash on method_missing methods"
This reverts commit 51d3ac08b10f2f063a6915b83e95329dd14613dd.
Showing
2 changed files
with
0 additions
and
11 deletions
Show diff stats
lib/noosfero/plugin/manager.rb
| ... | ... | @@ -38,8 +38,6 @@ class Noosfero::Plugin::Manager |
| 38 | 38 | end |
| 39 | 39 | |
| 40 | 40 | def result_for plugin, event, *args |
| 41 | - # check if defined to avoid crash, as there is hotspots using method_missing | |
| 42 | - return unless plugin.respond_to? event | |
| 43 | 41 | method = plugin.method event |
| 44 | 42 | method.call *args if method.owner != Noosfero::Plugin |
| 45 | 43 | end | ... | ... |
test/unit/plugin_manager_test.rb
| ... | ... | @@ -178,15 +178,6 @@ class PluginManagerTest < ActiveSupport::TestCase |
| 178 | 178 | assert_equal Plugin2, manager.fetch_first_plugin(:random_event) |
| 179 | 179 | end |
| 180 | 180 | |
| 181 | - should 'return nil if missing method is called' do | |
| 182 | - class Plugin1 < Noosfero::Plugin | |
| 183 | - end | |
| 184 | - Noosfero::Plugin.stubs(:all).returns(['PluginManagerTest::Plugin1']) | |
| 185 | - environment.enable_plugin(Plugin1) | |
| 186 | - | |
| 187 | - assert_equal nil, @manager.result_for(Plugin1.new, :content_remove_new) | |
| 188 | - end | |
| 189 | - | |
| 190 | 181 | should 'parse macro' do |
| 191 | 182 | class Plugin1 < Noosfero::Plugin |
| 192 | 183 | def macros | ... | ... |