Created
August 6, 2013 14:07
-
-
Save kyanny/6164775 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/unit' | |
class GemPessimisticVersionExpander | |
def expand(version) | |
"['>= %s', '< %s']" % [version, Gem::Version.create(version).bump] | |
end | |
end | |
class TestGemPessimisticVersionExpander < MiniTest::Unit::TestCase | |
def setup | |
@it = GemPessimisticVersionExpander.new | |
end | |
def test_expand_minor | |
assert_equal "['>= 1.2', '< 2']", @it.expand("1.2") | |
end | |
def test_expand_patch | |
assert_equal "['>= 1.24.1', '< 1.25']", @it.expand("1.24.1") | |
end | |
end | |
if __FILE__ == $0 | |
MiniTest::Unit.autorun | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment