Add rspec tests, refactoring of DetectNetworkCards