Files
ubicloud/spec/model/pci_device_spec.rb
Benjamin Satzger f66ec451f5 Introduce PciDevice model
Adds the concept of a PCI device. A PCI device always belongs to
a single VM host and may be bound to a single VM.
2024-05-07 16:10:05 +02:00

21 lines
553 B
Ruby

# frozen_string_literal: true
require_relative "spec_helper"
RSpec.describe PciDevice do
it "returns correctly that a device with class 300 is a gpu" do
d = described_class.new(device_class: "0300")
expect(d.is_gpu).to be_truthy
end
it "returns correctly that a device with class 302 is a gpu" do
d = described_class.new(device_class: "0302")
expect(d.is_gpu).to be_truthy
end
it "returns correctly that a device is not a gpu" do
d = described_class.new(device_class: "0403")
expect(d.is_gpu).to be_falsy
end
end