Sha256: 4674ffe18a6d7de61c01bb87db3df06baab93a652244d26ebde7ca94d47f619e
Contents?: true
Size: 861 Bytes
Versions: 53
Compression:
Stored size: 861 Bytes
Contents
FactoryBot.define do factory :discovered_host, class: 'Host::Discovered' do sequence(:name) { |n| "host#{n}" } sequence(:ip) { |n| IPAddr.new(n, Socket::AF_INET).to_s } sequence(:mac) { |n| "02:23:45:67:" + n.to_s(16).rjust(4, '0').insert(2, ':') } after(:build) do |discovered_host| attribute_set = DiscoveryAttributeSet.new(:host => discovered_host, :memory => '1', :cpu_count => '4') discovered_host.discovery_attribute_set = attribute_set end trait :with_facts do transient do fact_count { 20 } end after(:create) do |discovered_host, evaluator| evaluator.fact_count.times do FactoryBot.create(:fact_value, :host => discovered_host) end end end end end
Version data entries
53 entries across 53 versions & 1 rubygems