From 7750bb37d186eba4f307675096600cf23ee214aa Mon Sep 17 00:00:00 2001 From: Junior Silva Date: Thu, 27 Nov 2014 18:22:48 -0300 Subject: [PATCH] fix comment_classification plugin --- lib/tasks/plugins_tests.rake | 6 +++++- plugins/comment_classification/features/step_definitions/plugin_steps.rb | 13 ++++++++----- plugins/comment_classification/lib/comment_classification_plugin.rb | 2 -- plugins/comment_classification/lib/ext/comment.rb | 2 -- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/tasks/plugins_tests.rake b/lib/tasks/plugins_tests.rake index 517a193..c561f4f 100644 --- a/lib/tasks/plugins_tests.rake +++ b/lib/tasks/plugins_tests.rake @@ -108,7 +108,7 @@ def run_test(name, files) files = Array(files) plugin = filename2plugin(files.first) if name == :cucumber || name == :selenium - run_cucumber task2_profile(name, plugin), files + run_cucumber task2profile(name, plugin), files else run_testrb files end @@ -136,7 +136,11 @@ end def run_tests(name, plugins, run=:all) plugins = Array(plugins) + if name == :cucumber || name == :selenium + glob = "plugins/{#{plugins.join(',')}}/#{task2folder(name)}/**/*.#{task2ext(name)}" + else glob = "plugins/{#{plugins.join(',')}}/test/#{task2folder(name)}/**/*.#{task2ext(name)}" + end files = Dir.glob(glob) if files.empty? puts "I: no tests to run #{name}" diff --git a/plugins/comment_classification/features/step_definitions/plugin_steps.rb b/plugins/comment_classification/features/step_definitions/plugin_steps.rb index 93eb522..23b811a 100644 --- a/plugins/comment_classification/features/step_definitions/plugin_steps.rb +++ b/plugins/comment_classification/features/step_definitions/plugin_steps.rb @@ -1,9 +1,12 @@ Given /^CommentClassificationPlugin is enabled$/ do - step %{I am logged in as admin} - step %{I am on the environment control panel} - step %{I follow "Plugins"} - step %{I check "Comment Classification"} - step %{I press "Save changes"} + steps %Q{ + Given I am logged in as admin + Given I am on the environment control panel + Given I follow "Plugins" + Given I check "Comment Classification" + Given I press "Save changes" + } + Environment.default.enabled_plugins.should include("CommentClassificationPlugin") end diff --git a/plugins/comment_classification/lib/comment_classification_plugin.rb b/plugins/comment_classification/lib/comment_classification_plugin.rb index 69c35eb..b864734 100644 --- a/plugins/comment_classification/lib/comment_classification_plugin.rb +++ b/plugins/comment_classification/lib/comment_classification_plugin.rb @@ -1,5 +1,3 @@ -require 'ext/environment' -require 'ext/comment' class CommentClassificationPlugin < Noosfero::Plugin diff --git a/plugins/comment_classification/lib/ext/comment.rb b/plugins/comment_classification/lib/ext/comment.rb index cc07194..b6e5e84 100644 --- a/plugins/comment_classification/lib/ext/comment.rb +++ b/plugins/comment_classification/lib/ext/comment.rb @@ -1,6 +1,4 @@ require_dependency 'comment' -require 'comment_classification_plugin.rb' -require 'comment_classification_plugin/label.rb' class Comment -- libgit2 0.21.2