diff options
Diffstat (limited to 'spec/functions/load_module_metadata_spec.rb')
-rwxr-xr-x | spec/functions/load_module_metadata_spec.rb | 10 |
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 |