Sha256: 66c9db2b4c2c760ecf44b98f5a93db2c7eaa222f3dfc11b0482e71c3f84fee23
Contents?: true
Size: 1.18 KB
Versions: 4
Compression:
Stored size: 1.18 KB
Contents
require 'spec_helper' describe LitmusPaper::Metric::AvailableMemory do describe "#current_health" do it "multiplies weight by memory available" do facter = StubFacter.new({"memorytotal" => "10 GB", "memoryfree" => "5 GB"}) memory = LitmusPaper::Metric::AvailableMemory.new(50, facter) memory.current_health.should == 25 end describe "#memory_total" do it "is a positive integer" do metric = LitmusPaper::Metric::AvailableMemory.new(50) metric.memory_total.should > 1_000 end it "is cached" do Facter.should_receive(:value).once.and_return("10 MB") metric = LitmusPaper::Metric::AvailableMemory.new(50) metric.memory_total metric.memory_total metric.memory_total end end describe "#memory_free" do it "is a positive integer" do metric = LitmusPaper::Metric::AvailableMemory.new(50) metric.memory_free.should > 100 end end describe "#to_s" do it "is the name of the check and the max weight" do metric = LitmusPaper::Metric::AvailableMemory.new(50) metric.to_s.should == "Metric::AvailableMemory(50)" end end end end
Version data entries
4 entries across 4 versions & 1 rubygems