summaryrefslogtreecommitdiff
path: root/spec/functions/load_module_metadata_spec.rb
diff options
context:
space:
mode:
authorHailee Kenney <hailee@puppet.com>2017-03-03 16:40:32 +0000
committerGitHub <noreply@github.com>2017-03-03 16:40:32 +0000
commit01b951b4966c1fe150a160fdc8f4196b6e21ee51 (patch)
tree1643609784f5b46f3ef7ff1ca1c16e08b8c24d5f /spec/functions/load_module_metadata_spec.rb
parent9e28f8f80ab512efff5eba4fecbaadb4220ca01c (diff)
parent2f463600c2c0b6ac95ec71d3e5b17d1b2abdcd22 (diff)
Merge pull request #732 from pmcmaw/FM-6063-unitTests
(FM-6063) - Unit tests for high effort functions
Diffstat (limited to 'spec/functions/load_module_metadata_spec.rb')
-rwxr-xr-xspec/functions/load_module_metadata_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/functions/load_module_metadata_spec.rb b/spec/functions/load_module_metadata_spec.rb
index 841cd7d..9496fcb 100755
--- a/spec/functions/load_module_metadata_spec.rb
+++ b/spec/functions/load_module_metadata_spec.rb
@@ -10,6 +10,15 @@ describe 'load_module_metadata' do
allow(File).to receive(:read).with(/\/(stdlib|test)\/metadata.json/, {:encoding=>"utf-8"}).and_return('{"name": "puppetlabs-stdlib"}')
allow(File).to receive(:read).with(/\/(stdlib|test)\/metadata.json/).and_return('{"name": "puppetlabs-stdlib"}')
end
+
+ context "when calling with valid utf8 and double byte character arguments" do
+ before :each do
+ allow(File).to receive(:read).with(/\/(stdlib|test)\/metadata.json/, {:encoding=>"utf-8"}).and_return('{"ĭďèʼnţĩƒіểя": "ċơņťęאּť ỡƒ ţħíš -
+この文字"}')
+ allow(File).to receive(:read).with(/\/(stdlib|test)\/metadata.json/).and_return('{"ĭďèʼnţĩƒіểя": "ċơņťęאּť ỡƒ ţħíš -
+この文字"}')
+ end
+
it "should json parse the file" do
if Puppet::Util::Platform.windows?
allow(scope).to receive(:function_get_module_path).with(['science']).and_return('C:/path/to/module/')
@@ -47,5 +56,6 @@ describe 'load_module_metadata' do
result = subject.call(['science', true])
expect(result).to eq({})
end
+ end
end
end