Sha256: a33c43477cff3d081a13194461101ee7fce2f94722966963ba668ac1153f5f54
Contents?: true
Size: 1.48 KB
Versions: 1
Compression:
Stored size: 1.48 KB
Contents
require 'rubygems' if RUBY_VERSION < '1.9' require File.dirname(__FILE__) + '/../lib/os' # load before sane require 'sane' require 'spec/autorun' describe "OS" do it "has a windows? method" do if RUBY_PLATFORM =~ /mingw|mswin/ assert OS.windows? == true assert OS.doze? == true assert OS.posix? == false else # ltodo jruby if RUBY_PLATFORM =~ /linux/ assert OS.windows? == false assert OS.posix? == true end end end it "has a bits method" do if RUBY_PLATFORM =~ /mingw32/ assert OS.bits == 32 elsif RUBY_PLATFORM =~ /64/ # linux... assert OS.bits == 64 elsif RUBY_PLATFORM =~ /i686/ assert OS.bits == 32 elsif RUBY_PLATFORM =~ /java/ && RbConfig::CONFIG['host_os'] =~ /32$/ assert OS.bits == 32 else pending "os bits not tested!" + RUBY_PLATFORM + ' ' + RbConfig::CONFIG['host_os'] end end it "should know if you're on java" do if RUBY_PLATFORM == 'java' assert OS.java? == true # I want just this value... else assert OS.java? == false end end it "should have a ruby.exe method" do if OS.windows? assert OS.ruby_bin.include?('ruby.exe') else assert OS.ruby_bin.include?('ruby') && OS.ruby_bin.include?('/') end end it "should have a mac? method" do if RUBY_PLATFORM =~ /darwin/ assert OS.mac? else assert !OS.mac? end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
os-0.6.1 | spec/spec.os.rb |