spec/nagios/zfs/zpool_plugin_spec.rb in nagios-zfs-0.0.1 vs spec/nagios/zfs/zpool_plugin_spec.rb in nagios-zfs-0.1.0
- old
+ new
@@ -76,9 +76,19 @@
it 'always returns true' do
expect(plugin.ok?).to eq(true)
end
end
+ describe '#message' do
+ it 'includes the pool name and capcity' do
+ zpool = double('zpool')
+ zpool.should_receive(:name).and_return('tank')
+ zpool.should_receive(:capacity).and_return(42)
+ plugin.stub(:zpool).and_return(zpool)
+ expect(plugin.message).to eq('tank 42%')
+ end
+ end
+
describe '#zpool' do
let(:zpool) { double('zpool') }
before do
plugin.stub(:config).and_return({:zpool => 'tank'})