Skip to content

Commit

Permalink
removed initialize method
Browse files Browse the repository at this point in the history
  • Loading branch information
HarikaChebrolu committed May 26, 2020
1 parent 1d0737e commit d50bbb3
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 36 deletions.
2 changes: 2 additions & 0 deletions examples/shared_samples/interconnect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
# Supoported Variants
# C7000, Synergy

# for example, if api_version = 800 & variant = C7000 then, resource created will be in form
# OneviewSDK::API800::C7000::Interconnect

# Resource Class used in this sample
interconnect_class = OneviewSDK.resource_named('Interconnect', @client.api_version)
Expand Down
11 changes: 0 additions & 11 deletions lib/oneview-sdk/resource/api1600/c7000/interconnect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,6 @@ module C7000
# Interconnect resource implementation on API1600 C7000
class Interconnect < OneviewSDK::API1200::C7000::Interconnect
include OneviewSDK::ResourceHelper::ConfigurationOperation
# Create a resource object, associate it with a client, and set its properties.
# @param [OneviewSDK::Client] client The client object for the OneView appliance
# @param [Hash] params The options for this resource (key-value pairs)
# @param [Integer] api_ver The api version to use when interracting with this resource.
def initialize(client, params = {}, api_ver = nil)
@data ||= {}
# Default values
@data['type'] ||= 'InterconnectV7'
super
end

def self.api_version
1600
end
Expand Down
11 changes: 0 additions & 11 deletions lib/oneview-sdk/resource/api1600/synergy/interconnect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@ module API1600
module Synergy
# Interconnect resource implementation on API1600 Synergy
class Interconnect < OneviewSDK::API1200::Synergy::Interconnect
# Create a resource object, associate it with a client, and set its properties.
# @param [OneviewSDK::Client] client The client object for the OneView appliance
# @param [Hash] params The options for this resource (key-value pairs)
# @param [Integer] api_ver The api version to use when interracting with this resource.
def initialize(client, params = {}, api_ver = nil)
@data ||= {}
# Default values
@data['type'] ||= 'InterconnectV7'
super
end

def self.api_version
1600
end
Expand Down
17 changes: 10 additions & 7 deletions spec/unit/resource/api1600/c7000/interconnect_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
require 'spec_helper'

RSpec.describe OneviewSDK::API1600::C7000::Interconnect do
Expand All @@ -6,11 +16,4 @@
it 'inherits from OneviewSDK::API1200::C7000::Interconnect' do
expect(described_class).to be < OneviewSDK::API1200::C7000::Interconnect
end

describe '#initialize' do
it 'should be initialize the instance with default values' do
item = described_class.new(@client_1600)
expect(item['type']).to eq('InterconnectV7')
end
end
end
17 changes: 10 additions & 7 deletions spec/unit/resource/api1600/synergy/interconnect_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
require 'spec_helper'

RSpec.describe OneviewSDK::API1600::Synergy::Interconnect do
Expand All @@ -6,11 +16,4 @@
it 'inherits from OneviewSDK::API1200::Synergy::Interconnect' do
expect(described_class).to be < OneviewSDK::API1200::Synergy::Interconnect
end

describe '#initialize' do
it 'should be initialize the instance with default values' do
item = described_class.new(@client_1600)
expect(item['type']).to eq('InterconnectV7')
end
end
end

0 comments on commit d50bbb3

Please sign in to comment.