Files
ubicloud/spec/lib/option_spec.rb
Maciek Sarnowicz 77e64f94ce Removing use_slices_for_allocation flag
Removing the project feature flag `use_slices_for_allocation` and making it the default to use slices. We still keep the `use_slices` parameter in the request to make it easier to turn off the allocation logic for slices if needed. It can be completely removed in the future.
2025-03-05 14:33:16 -08:00

27 lines
798 B
Ruby

# frozen_string_literal: true
require "rspec"
require_relative "../../lib/option"
RSpec.describe Option do
describe "#VmSize options" do
it "no burstable cpu allowed for Standard VMs" do
expect(Option::VmSizes.map { _1.name.include?("standard-") == (_1.cpu_burst_percent_limit == 0) }.all?(true)).to be true
end
it "no gpu allowed for non-GPU VMs" do
expect(Option::VmSizes.map { _1.name.include?("gpu") == _1.gpu }.all?(true)).to be true
end
it "no odd number of vcpus allowed, except for 1" do
expect(Option::VmSizes.all? { _1.vcpus == 1 || _1.vcpus.even? }).to be true
end
end
describe "#VmFamily options" do
it "families include burstables" do
expect(described_class.families.map(&:name)).to include("burstable")
end
end
end