Project

General

Profile

Defect #35345 » 35345-v2.patch

Go MAEDA, 2021-06-24 16:21

View differences:

lib/redmine/plugin.rb
275 275

  
276 276
    def compare_versions(requirement, current)
277 277
      requirement = requirement.split('.').collect(&:to_i)
278
      requirement <=> current.slice(0, requirement.size)
278
      requirement <=> current.slice(0, requirement.size).collect(&:to_i)
279 279
    end
280 280
    private :compare_versions
281 281

  
test/unit/lib/redmine/plugin_test.rb
134 134
    assert_raise Redmine::PluginRequirementError do
135 135
      plugin.requires_redmine(:version => '2.2')
136 136
    end
137
    assert plugin.requires_redmine(:version => '2.1.3.stable')
138
    assert plugin.requires_redmine(:version => '2.1.3.devel')
137 139
    # Version range
138 140
    assert plugin.requires_redmine(:version => '2.0.0'..'2.2.4')
139 141
    assert plugin.requires_redmine(:version => '2.1.3'..'2.2.4')
(2-2/2)