Sha256: 4467e2c68bff982a0e37e3595ec02e7c712ea70de30ae5e84c8e87400ac853f6

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

###########################################################
# tc_version.rb
#
# The sole purpose of this test case is to verify the
# version.  This reduces the pain of having separate tests
# for the VERSION constant in every single test case.
###########################################################
base = File.basename(Dir.pwd)

if base == "test" || base =~ /sys-cpu/
   require "ftools"

   Dir.chdir("..") if base == "test"
   Dir.mkdir("sys") unless File.exist?("sys")

   case RUBY_PLATFORM
      when /mswin|dos|cygwin|mingw/i
         file = 'lib/sys/windows.rb'
      when /linux/i
         file = 'lib/sys/linux.rb'
      else
         require "rbconfig"
         file = "cpu." << Config::CONFIG["DLEXT"]
   end

   if File.exist?(file)
      File.copy(file, "sys/cpu.rb")
   else
      puts "No '#{file}' file found.  Please run extconf.rb and make first"
      exit
   end

   $LOAD_PATH.unshift Dir.pwd
end

require "sys/cpu"
require "test/unit"
include Sys

class TC_Sys_CPU_VERSION < Test::Unit::TestCase
   def test_version
      assert_equal('0.5.5', CPU::VERSION)
   end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sys-cpu-0.5.5-i586-linux test/tc_version.rb
sys-cpu-0.5.5 test/tc_version.rb