File: cpu_spec.rb

package info (click to toggle)
ruby-vmstat 2.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 344 kB
  • sloc: ruby: 1,136; ansic: 347; makefile: 3
file content (34 lines) | stat: -rw-r--r-- 853 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
require 'spec_helper'

describe Vmstat::Cpu do
  context "Vmstat#cpu" do
    let(:cpu) { Vmstat.cpu }

    it "should return an array of ethernet information" do
      cpu.should be_a(Array)
    end

    context "first cpu" do
      let(:first_cpu) { cpu.first }
      subject { first_cpu }

      it "should return a vmstat cpu object" do
        should be_a(described_class)
      end

      context "methods" do
        it { should respond_to(:user) }
        it { should respond_to(:system) }
        it { should respond_to(:nice) }
        it { should respond_to(:idle) }
      end

      context "content" do
        its(:user) { should be_a_kind_of(Numeric) }
        its(:system) { should be_a_kind_of(Numeric) }
        its(:nice) { should be_a_kind_of(Numeric) }
        its(:idle) { should be_a_kind_of(Numeric) }
      end
    end
  end
end