summaryrefslogtreecommitdiff
path: root/spec/functions
diff options
context:
space:
mode:
authorDavid Schmitt <david.schmitt@puppet.com>2017-02-21 14:01:28 +0000
committerGitHub <noreply@github.com>2017-02-21 14:01:28 +0000
commitf564377492018de351b365f4205d422d41d2865b (patch)
tree5934267b1f51a0bcca1ae66c3fcb9bffe2a5860b /spec/functions
parentcd7575c46d4c85a68b1570d73663805b4218eea3 (diff)
parent20855b9d24de7a8b02b7f5beb70a16139a6c3d74 (diff)
Merge pull request #714 from pmcmaw/SPIKEi18N
(FM-6019) - i18N tests for Spike
Diffstat (limited to 'spec/functions')
-rwxr-xr-xspec/functions/any2array_spec.rb6
-rwxr-xr-xspec/functions/ensure_resource_spec.rb24
2 files changed, 30 insertions, 0 deletions
diff --git a/spec/functions/any2array_spec.rb b/spec/functions/any2array_spec.rb
index 70121f1..631657f 100755
--- a/spec/functions/any2array_spec.rb
+++ b/spec/functions/any2array_spec.rb
@@ -12,4 +12,10 @@ describe "any2array" do
it { is_expected.to run.with_params({}).and_return([]) }
it { is_expected.to run.with_params({ 'key' => 'value' }).and_return(['key', 'value']) }
it { is_expected.to run.with_params({ 'key' => 'value' }).and_return(['key', 'value']) }
+
+ it { is_expected.to run.with_params('‰').and_return(['‰']) }
+ it { is_expected.to run.with_params('竹').and_return(['竹']) }
+ it { is_expected.to run.with_params('Ü').and_return(['Ü']) }
+ it { is_expected.to run.with_params('∇').and_return(['∇']) }
+ it { is_expected.to run.with_params('€', '万', 'Ö', '♥', '割').and_return(['€', '万', 'Ö', '♥', '割']) }
end
diff --git a/spec/functions/ensure_resource_spec.rb b/spec/functions/ensure_resource_spec.rb
index d552f4e..fddc4c4 100755
--- a/spec/functions/ensure_resource_spec.rb
+++ b/spec/functions/ensure_resource_spec.rb
@@ -38,7 +38,31 @@ describe 'ensure_resource' do
it { expect(lambda { catalogue }).to contain_user('username1').with_ensure('present') }
it { expect(lambda { catalogue }).to contain_user('username1').without_gid }
end
+ end
+
+ context 'given a catalog with UTF8 chars' do
+ describe 'after running ensure_resource("user", "Şắოрŀễ Ţëם", {})' do
+ before { subject.call(['User', 'Şắოрŀễ Ţëם', {}]) }
+
+ # this lambda is required due to strangeness within rspec-puppet's expectation handling
+ it { expect(lambda { catalogue }).to contain_user('Şắოрŀễ Ţëם').without_ensure }
+ end
+
+ describe 'after running ensure_resource("user", "Şắოрŀễ Ţëם", { gid => undef })' do
+ before { subject.call(['User', 'Şắოрŀễ Ţëם', { 'gid' => :undef }]) }
+ # this lambda is required due to strangeness within rspec-puppet's expectation handling
+ it { expect(lambda { catalogue }).to contain_user('Şắოрŀễ Ţëם').without_ensure }
+ it { expect(lambda { catalogue }).to contain_user('Şắოрŀễ Ţëם').without_gid }
+ end
+
+ describe 'after running ensure_resource("user", "Şắოрŀễ Ţëם", { ensure => present, gid => undef })' do
+ before { subject.call(['User', 'Şắოрŀễ Ţëם', { 'ensure' => 'present', 'gid' => :undef }]) }
+
+ # this lambda is required due to strangeness within rspec-puppet's expectation handling
+ it { expect(lambda { catalogue }).to contain_user('Şắოрŀễ Ţëם').with_ensure('present') }
+ it { expect(lambda { catalogue }).to contain_user('Şắოрŀễ Ţëם').without_gid }
+ end
end
context 'given a catalog with "user { username1: ensure => present }"' do