Skip to content

Instantly share code, notes, and snippets.

@GregSutcliffe
Created December 10, 2014 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GregSutcliffe/1a0ee3d7a169caa8c502 to your computer and use it in GitHub Desktop.
Save GregSutcliffe/1a0ee3d7a169caa8c502 to your computer and use it in GitHub Desktop.
FactoryGirl.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, ':') }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment