Sha256: a3f64aac6967ff05c445614b0f0fd7f26674418c955df94420560e6faf3b7b4f
Contents?: true
Size: 1.46 KB
Versions: 83
Compression:
Stored size: 1.46 KB
Contents
require 'epitools' describe Sys::ProcessInfo do specify "checks OS" do proc { Sys.os }.should_not raise_error proc { Sys.linux? }.should_not raise_error proc { Sys.mac? }.should_not raise_error proc { Sys.darwin? }.should_not raise_error proc { Sys.bsd? }.should_not raise_error proc { Sys.windows? }.should_not raise_error %w[Linux Windows Darwin BSD].include?(Sys.os).should == true [:linux?, :mac?, :windows?, :bsd?].any?{|os| Sys.send(os)}.should == true end specify "list all processes" do # procs = Sys.ps # # procs.first.state.is_a?(Array).should == true # # pids = procs.map{ |process| process.pid } # # p2s = Hash[ *Sys.ps(*pids).map { |process| [process.pid, process] }.flatten ] # matches = 0 # procs.each do |p1| # if p2 = p2s[p1.pid] # matches += 1 # p1.command.should == p2.command # end # end # # matches.should > 1 end specify "refresh processes" do # STDOUT.sync = true # # procs = Sys.ps # procs.shuffle! # procs.each do |process| # proc do # begin # process.refresh # print "." # rescue Sys::ProcessNotFound # end # end.should_not raise_error # end # # puts end specify "cross-platform method" do Sys.cross_platform_method(:cross_platform_test) proc{ Sys.cross_platform_test }.should raise_error end specify "interfaces" do Sys.interfaces.should_not be_blank end end
Version data entries
83 entries across 83 versions & 1 rubygems