From 2f463600c2c0b6ac95ec71d3e5b17d1b2abdcd22 Mon Sep 17 00:00:00 2001 From: Paula McMaw Date: Fri, 3 Mar 2017 15:25:53 +0000 Subject: (FM-6063) - Unit tests for high effort functions --- spec/functions/ensure_packages_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spec/functions/ensure_packages_spec.rb') diff --git a/spec/functions/ensure_packages_spec.rb b/spec/functions/ensure_packages_spec.rb index 5d97684..6f94d72 100755 --- a/spec/functions/ensure_packages_spec.rb +++ b/spec/functions/ensure_packages_spec.rb @@ -36,9 +36,16 @@ describe 'ensure_packages' do context 'given hash of packages' do before { subject.call([{"foo" => { "provider" => "rpm" }, "bar" => { "provider" => "gem" }}, { "ensure" => "present"}]) } + before { subject.call([{"パッケージ" => { "ensure" => "absent"}}]) } + before { subject.call([{"ρǻ¢κầģẻ" => { "ensure" => "absent"}}]) } # this lambda is required due to strangeness within rspec-puppet's expectation handling it { expect(lambda { catalogue }).to contain_package('foo').with({'provider' => 'rpm', 'ensure' => 'present'}) } it { expect(lambda { catalogue }).to contain_package('bar').with({'provider' => 'gem', 'ensure' => 'present'}) } + + context 'should run with UTF8 and double byte characters' do + it { expect(lambda { catalogue }).to contain_package('パッケージ').with({'ensure' => 'absent'}) } + it { expect(lambda { catalogue }).to contain_package('ρǻ¢κầģẻ').with({'ensure' => 'absent'}) } + end end end -- cgit v1.2.3