Sha256: a8b653b85b8abf889169191b3d4c31a34222da902d8758407898d7b2c455299e
Contents?: true
Size: 1.06 KB
Versions: 1
Compression:
Stored size: 1.06 KB
Contents
require File.join(File.dirname(__FILE__), '..', '..', 'test_helper') class VersionMatcherTest < Test::Unit::TestCase setup do @module = VirtualBox::AbstractModel::VersionMatcher @klass = Class.new @klass.send(:extend, @module) end context "asserting version matches" do should "raise an exception if versions do not match" do assert_raises(VirtualBox::Exceptions::UnsupportedVersionException) { @klass.assert_version_match("3.1", "3.2.4") } end should "not raise an exception if versions do match" do assert_nothing_raised { @klass.assert_version_match("3.0", "3.0.14") } end end context "version matching" do should "return true if versions match" do assert @klass.version_match?("3.2", "3.2.4") assert !@klass.version_match?("3.1", "3.2.4") end end context "splitting version" do should "split into a max of two parts by period" do assert_equal %W[3 2], @klass.split_version("3.2.0") assert_equal %W[3 1], @klass.split_version("3.1.1.1.1") end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
virtualbox-0.7.2 | test/virtualbox/abstract_model/version_matcher_test.rb |