Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Commit

Permalink
Unit tests for new block feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
coderanger committed Mar 28, 2017
1 parent 6cd5677 commit 60aad58
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions test/spec/system/mixin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,30 @@ def action_run
dev_package_overrides: {},
package_version: nil,
version: '') }

context 'with a block override' do
provider(:poise_test) do
include Poise
include described_class
def system_package_name
'mylang'
end
def options
{}
end
def action_run
install_system_packages do
dev_package false
end
end
end

it { is_expected.to install_poise_languages_system('mylang').with(parent: chef_run.poise_test('test'),
dev_package: false,
dev_package_overrides: {},
package_version: nil,
version: '') }
end # /context with a block override
end # /describe #install_system_packages

describe '#uninstall_system_packages' do
Expand All @@ -67,6 +91,26 @@ def action_run
end

it { is_expected.to uninstall_poise_languages_system('mylang') }

context 'with a block override' do
provider(:poise_test) do
include Poise
include described_class
def system_package_name
'mylang'
end
def options
{}
end
def action_run
uninstall_system_packages do
dev_package false
end
end
end

it { is_expected.to uninstall_poise_languages_system('mylang').with(dev_package: false) }
end # /context with a block override
end # /describe #uninstall_system_packages

describe '#system_package_candidates' do
Expand Down

0 comments on commit 60aad58

Please sign in to comment.