From 4b901898589d4ac9148db6d0227ff3c46f19f569 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Sun, 18 Dec 2011 19:44:12 +0000 Subject: [PATCH] Complement test plugin --- plugins/foo/README | 2 ++ plugins/foo/lib/foo_plugin.rb | 2 ++ plugins/foo/lib/foo_plugin/ext/profile.rb | 6 ++++++ plugins/foo/test/unit/foo_plugin_test.rb | 3 +++ 4 files changed, 13 insertions(+), 0 deletions(-) create mode 100644 plugins/foo/README create mode 100644 plugins/foo/lib/foo_plugin/ext/profile.rb diff --git a/plugins/foo/README b/plugins/foo/README new file mode 100644 index 0000000..acae349 --- /dev/null +++ b/plugins/foo/README @@ -0,0 +1,2 @@ +This is a small plugin used to debug some problems that may happen with other +plugins. diff --git a/plugins/foo/lib/foo_plugin.rb b/plugins/foo/lib/foo_plugin.rb index b74f6f7..b6dc1af 100644 --- a/plugins/foo/lib/foo_plugin.rb +++ b/plugins/foo/lib/foo_plugin.rb @@ -1,3 +1,5 @@ +require_dependency 'foo_plugin/ext/profile' + class FooPlugin < Noosfero::Plugin def self.plugin_name diff --git a/plugins/foo/lib/foo_plugin/ext/profile.rb b/plugins/foo/lib/foo_plugin/ext/profile.rb new file mode 100644 index 0000000..058f5c7 --- /dev/null +++ b/plugins/foo/lib/foo_plugin/ext/profile.rb @@ -0,0 +1,6 @@ +require_dependency 'profile' + +Profile.class_eval do + def bar + end +end diff --git a/plugins/foo/test/unit/foo_plugin_test.rb b/plugins/foo/test/unit/foo_plugin_test.rb index e3bf10f..71d51e0 100644 --- a/plugins/foo/test/unit/foo_plugin_test.rb +++ b/plugins/foo/test/unit/foo_plugin_test.rb @@ -4,4 +4,7 @@ class FooPluginTest < ActiveSupport::TestCase def test_foo FooPlugin::Bar.create! end + def test_monkey_patch + Profile.new.bar + end end -- libgit2 0.21.2