hardware_spec.rb 603 B

12345678910111213141516
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe SystemReport::Plugin::Hardware, current_user_id: 1, type: :model do
  4. it 'does calculate total memory' do
  5. expect(described_class.new.fetch['total_memory'].class).to eq(Integer)
  6. end
  7. it 'does also work when the open result is an array #5402', :aggregate_failures do
  8. instance = described_class.new
  9. result = described_class.new.send(:execute)
  10. allow(instance).to receive(:execute).and_return(Array.wrap(result))
  11. expect { instance.fetch }.not_to raise_error
  12. end
  13. end