Skip to content

Commit

Permalink
Drop in the proper provider mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
hartmantis committed Apr 20, 2015
1 parent bfd67f9 commit 82f70cb
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
26 changes: 26 additions & 0 deletions libraries/provider_mapping.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Encoding: UTF-8
#
# Cookbook Name:: microsoft-remote-desktop
# Library:: provider_mapping
#
# Copyright 2015 Jonathan Hartman
#
# 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 'chef/dsl'
require 'chef/platform/provider_mapping'

Chef::Platform.set(platform: :mac_os_x,
resource: :microsoft_remote_desktop_app,
provider: Chef::Provider::MacAppStoreApp)
27 changes: 27 additions & 0 deletions spec/libraries/provider_mapping_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Encoding: UTF-8

require_relative '../spec_helper'
require_relative '../../libraries/provider_mapping'

describe :provider_mapping do
let(:platform) { nil }
let(:app_provider) do
Chef::Platform.platforms[platform][:default][:microsoft_remote_desktop_app]
end

context 'Mac OS X' do
let(:platform) { :mac_os_x }

it 'uses the MacAppStoreApp app provider' do
expect(app_provider).to eq(Chef::Provider::MacAppStoreApp)
end
end

context 'Ubuntu' do
let(:platform) { :ubuntu }

it 'returns no app provider' do
expect(app_provider).to eq(nil)
end
end
end

0 comments on commit 82f70cb

Please sign in to comment.