Sha256: 20de95ec23c70181bc49c185a07ec91a855b1b55a2b9b012ce14be592f7a34f5

Contents?: true

Size: 870 Bytes

Versions: 56

Compression:

Stored size: 870 Bytes

Contents

require 'test_helper'
require 'tins'

module Tins
  class StringVersionTest < Test::Unit::TestCase
    def test_comparison
      assert_operator '1.2'.version, :<, '1.3'.version
      assert_operator '1.3'.version, :>, '1.2'.version
      assert_operator '1.2'.version, :<=, '1.2'.version
      assert_operator '1.2'.version, :>=, '1.2'.version
      assert_operator '1.2'.version, :==, '1.2'.version
    end

    def test_change
      s = '1.2'
      s.version.revision = 1
      assert_equal '1.2.0.1', s
      s.version.revision += 1
      assert_equal '1.2.0.2', s
      s.version.succ!
      assert_equal '1.2.0.3', s
      s.version.pred!
      assert_equal '1.2.0.2', s
      assert_raise(ArgumentError) { s.version.build -= 1 }
      s.version.major = 2
      assert_equal '2.2.0.2', s
      s.version.minor = 1
      assert_equal '2.1.0.2', s
    end
  end
end

Version data entries

56 entries across 55 versions & 3 rubygems

Version Path
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/tins-0.13.2/tests/string_version_test.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/tins-0.13.2/tests/string_version_test.rb
tdiary-5.0.8 vendor/bundle/gems/tins-0.13.2/tests/string_version_test.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/tins-0.13.2/tests/string_version_test.rb
tins-1.4.2 tests/string_version_test.rb
tins-1.4.1 tests/string_version_test.rb
tins-1.4.0 tests/string_version_test.rb
tins-1.3.5 tests/string_version_test.rb
tins-1.3.4 tests/string_version_test.rb
tins-1.3.3 tests/string_version_test.rb
tins-1.3.2 tests/string_version_test.rb
tins-1.3.1 tests/string_version_test.rb
tins-1.3.0 tests/string_version_test.rb
tins-1.2.0 tests/string_version_test.rb
tins-1.1.0 tests/string_version_test.rb
tins-1.0.1 tests/string_version_test.rb
tins-1.0.0 tests/string_version_test.rb
tins-0.13.2 tests/string_version_test.rb
social_url_stats-0.0.1 vendor/ruby/1.9.1/gems/tins-0.13.1/tests/string_version_test.rb
tins-0.13.1 tests/string_version_test.rb