Skip to content

Commit

Permalink
Refs fog#208 - add vcr webmock testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ezr-ondrej committed Apr 17, 2019
1 parent 57c97bb commit 4ea31b0
Show file tree
Hide file tree
Showing 26 changed files with 8,346 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fog-vsphere.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
spec.homepage = 'https://github.com/fog/fog-vsphere'
spec.license = 'MIT'

spec.files = `git ls-files -z`.split("\x0")
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(tests?|spec|features)/}) }
spec.test_files = spec.files.grep(%r{^tests\/})

spec.require_paths = ['lib']
Expand All @@ -31,4 +31,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rubocop', '~> 0.50.0'
spec.add_development_dependency 'mocha', '~> 1.8'
spec.add_development_dependency 'shindo', '~> 0.3'
spec.add_development_dependency 'webmock', '~> 3.5'
spec.add_development_dependency 'vcr', '~> 4.0'
end
9 changes: 9 additions & 0 deletions lib/fog/vsphere/requests/compute/get_network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ def get_raw_network(ref_or_name, datacenter_name, distributedswitch = nil)
finder = choose_finder(ref_or_name, distributedswitch)
get_all_raw_networks(datacenter_name).find { |n| finder.call(n) }
end

def network_attributes(network, datacenter_name)
{
id: managed_obj_id(network),
name: network.name,
datacenter: datacenter_name,
vlanid: nil
}
end
end

module Shared
Expand Down
Loading

0 comments on commit 4ea31b0

Please sign in to comment.