Add plugin updating capability

This commit is contained in:
Naoki Takezoe
2014-06-29 14:26:33 +09:00
parent 0e1d184715
commit 0b3781ec8a
5 changed files with 110 additions and 34 deletions

View File

@@ -0,0 +1,22 @@
package plugin
import org.specs2.mutable._
class PluginSystemSpec extends Specification {
"isUpdatable" should {
"return true for updattable plugin" in {
PluginSystem.isUpdatable("1.0.0", "1.0.1") must beTrue
PluginSystem.isUpdatable("1.0.0", "1.1.0") must beTrue
PluginSystem.isUpdatable("1.1.1", "1.2.0") must beTrue
PluginSystem.isUpdatable("1.2.1", "2.0.0") must beTrue
}
"return false for not updattable plugin" in {
PluginSystem.isUpdatable("1.0.0", "1.0.0") must beFalse
PluginSystem.isUpdatable("1.0.1", "1.0.0") must beFalse
PluginSystem.isUpdatable("1.1.1", "1.1.0") must beFalse
PluginSystem.isUpdatable("2.0.0", "1.2.1") must beFalse
}
}
}