Sha256: 522aeed305f88b4856e95e6327786a9af87e095975b786e95c1f9801120e895d

Contents?: true

Size: 1.35 KB

Versions: 2

Compression:

Stored size: 1.35 KB

Contents

#!/usr/bin/ruby
# encoding: utf-8
# (c) 2011 Martin Kozák (martinkozak@martinkozak.net)

$:.push("./lib")
require "ruby-version"
require "riot"

DOWN = :"1.8.7"
CURRENT = :"1.9.2"
UP = :"2.0.1"

context "Ruby::Version" do
    asserts("#<") do
        Ruby::Version < UP and not Ruby::Version < DOWN and not Ruby::Version < CURRENT
    end
    asserts("#<=") do
        Ruby::Version <= UP and not Ruby::Version <= DOWN and Ruby::Version <= CURRENT
    end
    asserts("#==") do
        not Ruby::Version == UP and not Ruby::Version == DOWN and Ruby::Version == CURRENT
    end
    asserts("#>") do
        not Ruby::Version > UP and Ruby::Version > DOWN and not Ruby::Version > CURRENT
    end
    asserts("#>=") do
        not Ruby::Version >= UP and Ruby::Version >= DOWN and Ruby::Version >= CURRENT
    end
    asserts("#<=>") do
        (Ruby::Version <=> UP) == -1 and (Ruby::Version <=> DOWN) == 1 and (Ruby::Version <=> CURRENT) == 0
    end
    asserts("#TOKENS") do
        Ruby::Version::TOKENS == Ruby::Version::broke(RUBY_VERSION)
    end
    asserts("#VERSION") do
        Ruby::Version::VERSION == RUBY_VERSION
    end
    asserts("#broke") do
        Ruby::Version::broke("1.2.3") == [1, 2, 3]
    end
    asserts("#compare") do
        Ruby::Version::compare(DOWN) == 1 and Ruby::Version::compare(CURRENT) == 0 and Ruby::Version::compare(UP) == -1
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-version-0.3.1 test
ruby-version-0.3.0 test