Skip to content

Commit

Permalink
test coverage increase
Browse files Browse the repository at this point in the history
  • Loading branch information
rderoldan1 committed Jul 25, 2013
1 parent 7b4a522 commit d191a19
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 141 deletions.
71 changes: 71 additions & 0 deletions spec/general_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
require 'rspec'
require 'spec_helper'

describe 'IncludeLibrary' do
it 'should include the library' do
a = Usagewatch
a.should be Usagewatch
end
end

describe 'DiskUsage' do
it "should be the GB of disk used" do
a = Usagewatch.uw_diskused
a.class.should be(Float)
a.should_not be_nil
a.should be >= 0
end
end

describe 'CPUUsage' do
it "should be the percentage of cpu used" do
a = Usagewatch.uw_cpuused
a.class.should be(Float)
a.should_not be_nil
a.should be <= 100
a.should be >= 0
end
end

describe 'PercentageDiskUsage' do
it "should be the percentage of GB of disk used" do
a = Usagewatch.uw_diskused_perc
a.class.should be(Float)
a.should_not be_nil
a.should be <= 100
a.should be >= 0
end
end

describe 'LoadAverage' do
it "should be the average load of the past minute" do
a = Usagewatch.uw_load
a.class.should be(Float)
a.should_not be_nil
a.should be >= 0
end
end

describe 'TopCPUUsage' do
it "should be an array of top cpu consumption proccesses " do
a = Usagewatch.uw_cputop
a.class.should be(Array )
a.should_not be_nil
a[0][0].class.should be String
a[0][1].class.should be String
a.count.should be == 10
end
end

describe 'TopMEMUsage' do
it "should be an array of top mem consumption proccesses " do
a = Usagewatch.uw_cputop
a.class.should be(Array )
a.should_not be_nil
a[0][0].class.should be String
a[0][1].class.should be String
a.count.should be == 10
end
end


67 changes: 0 additions & 67 deletions spec/linux_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,6 @@

os = RUBY_PLATFORM
if os.include? "linux"
describe 'IncludeLibrary' do
it 'should include the library' do
a = Usagewatch
a.should be Usagewatch
end
end

describe 'DiskUsage' do
it "should be the GB of disk used" do
a = Usagewatch.uw_diskused
a.class.should be(Float)
a.should_not be_nil
a.should be >= 0
end
end

describe 'CPUUsage' do
it "should be the percentage of cpu used" do
a = Usagewatch.uw_cpuused
a.class.should be(Float)
a.should_not be_nil
a.should be <= 100
a.should be >= 0
end
end

describe 'PercentageDiskUsage' do
it "should be the percentage of GB of disk used" do
a = Usagewatch.uw_diskused_perc
a.class.should be(Float)
a.should_not be_nil
a.should be <= 100
a.should be >= 0
end
end

describe 'LoadAverage' do
it "should be the average load of the past minute" do
a = Usagewatch.uw_load
a.class.should be(Float)
a.should_not be_nil
a.should be >= 0
end
end

describe 'TopCPUUsage' do
it "should be an array of top cpu consumption proccesses " do
a = Usagewatch.uw_cputop
a.class.should be(Array )
a.should_not be_nil
a[0][0].class.should be String
a[0][1].class.should be String
a.count.should be == 10
end
end

describe 'TopMEMUsage' do
it "should be an array of top mem consumption proccesses " do
a = Usagewatch.uw_cputop
a.class.should be(Array )
a.should_not be_nil
a[0][0].class.should be String
a[0][1].class.should be String
a.count.should be == 10
end
end

describe 'TCPConnectios' do
it 'should TCP Connections Used' do
a = Usagewatch.uw_tcpused
Expand Down
74 changes: 0 additions & 74 deletions spec/mac_spec.rb

This file was deleted.

0 comments on commit d191a19

Please sign in to comment.