From a4c55d5bf4928a434ade8af8cb3e16a72df501cd Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Mon, 13 Feb 2017 20:28:04 -0800 Subject: [PATCH] (POOLER-73) Add spec tests for migration_limit Add spec tests for migration_limit --- spec/unit/pool_manager_spec.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/spec/unit/pool_manager_spec.rb b/spec/unit/pool_manager_spec.rb index 3e2fb76..2b77f0c 100644 --- a/spec/unit/pool_manager_spec.rb +++ b/spec/unit/pool_manager_spec.rb @@ -955,6 +955,28 @@ EOT end end + describe '#migration_limit' do + # This is a little confusing. Is this supposed to return a boolean + # or integer type? + [false,0].each do |testvalue| + it "should return false for an input of #{testvalue}" do + expect(subject.migration_limit(testvalue)).to eq(false) + end + end + + [1,32768].each do |testvalue| + it "should return #{testvalue} for an input of #{testvalue}" do + expect(subject.migration_limit(testvalue)).to eq(testvalue) + end + end + + [-1,-32768].each do |testvalue| + it "should return nil for an input of #{testvalue}" do + expect(subject.migration_limit(testvalue)).to be_nil + end + end + end + describe '#migrate_vm' do let(:vsphere) { double('vsphere') }