summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-11-17 10:07:21 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-11-17 10:07:21 +0000
commitb3cf67cad4106c8176f7f4adcc07cedce2740cd3 (patch)
tree6a242ac4a32c756d39ea16898959136389b53ca9 /test
parent19bd8577908f293716eca2bf0bca4d99495c4a21 (diff)
downloadredmine-b3cf67cad4106c8176f7f4adcc07cedce2740cd3.tar.gz
redmine-b3cf67cad4106c8176f7f4adcc07cedce2740cd3.zip
Makes Plugin#requires_redmine accept only major and minor version (#12299).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10826 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/lib/redmine/plugin_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/plugin_test.rb b/test/unit/lib/redmine/plugin_test.rb
index 2b0bcc074..c5fb0ff93 100644
--- a/test/unit/lib/redmine/plugin_test.rb
+++ b/test/unit/lib/redmine/plugin_test.rb
@@ -88,24 +88,36 @@ class Redmine::PluginTest < ActiveSupport::TestCase
Redmine::VERSION.stubs(:to_a).returns([2, 1, 3, "stable", 10817])
assert plugin.requires_redmine('2.1.3')
+ assert plugin.requires_redmine('2.1')
assert_raise Redmine::PluginRequirementError do
plugin.requires_redmine('2.1.4')
end
+ assert_raise Redmine::PluginRequirementError do
+ plugin.requires_redmine('2.2')
+ end
assert plugin.requires_redmine(:version_or_higher => '0.1.0')
assert plugin.requires_redmine(:version_or_higher => '2.1.3')
+ assert plugin.requires_redmine(:version_or_higher => '2.1')
assert_raise Redmine::PluginRequirementError do
plugin.requires_redmine(:version_or_higher => '2.2.0')
end
+ assert_raise Redmine::PluginRequirementError do
+ plugin.requires_redmine(:version_or_higher => '2.2')
+ end
assert plugin.requires_redmine(:version => '2.1.3')
assert plugin.requires_redmine(:version => ['2.1.3', '2.2.0'])
+ assert plugin.requires_redmine(:version => '2.1')
assert_raise Redmine::PluginRequirementError do
plugin.requires_redmine(:version => '2.2.0')
end
assert_raise Redmine::PluginRequirementError do
plugin.requires_redmine(:version => ['2.1.4', '2.2.0'])
end
+ assert_raise Redmine::PluginRequirementError do
+ plugin.requires_redmine(:version => '2.2')
+ end
end
def test_requires_redmine_plugin