Sha256: 1164ef1d71fa1107d1c05ca6df6158dc2da690f76aa033823b99311b6405285d

Contents?: true

Size: 1.65 KB

Versions: 1

Compression:

Stored size: 1.65 KB

Contents

#-------------------------------------------------------------------------
# Copyright 2013 Microsoft Open Technologies, Inc.
#
# 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 "test_helper"

describe Azure::BaseManagement::Location do

  subject do
    Azure::BaseManagementService.new
  end

  describe "#list_role_sizes" do
    let(:request_path) { '/locations' }
    let(:locations_xml) { Fixtures['list_locations'] }
    let(:mock_request){ mock() }
    let(:response) {
      response = mock()
      response.stubs(:body).returns(locations_xml)
      response
    }
    let(:response_body) { Nokogiri::XML response.body }

    before {
      Azure::BaseManagement::ManagementHttpRequest.stubs(:new).with(:get, request_path, nil).returns(mock_request)
      mock_request.expects(:call).returns(response_body)
    }

    it "assembles a URI for the request" do
      subject.list_role_sizes
    end

    it "returns a list of role-sizes that are valid for given subscription" do
      results = subject.list_role_sizes
      results.must_be_kind_of Array
      results.length.must_equal 21
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
juliusl-azure-sdk-for-ruby-0.7.0 test/unit/base_management/role_size_test.rb