summaryrefslogtreecommitdiff
path: root/spec/functions/parseyaml_spec.rb
diff options
context:
space:
mode:
authorVarac <varac@leap.se>2017-10-13 14:22:08 +0200
committerVarac <varac@leap.se>2017-10-13 14:22:08 +0200
commitf7779ce2eacaca51790d4e8d7756442b02612d30 (patch)
tree56871c123e1c964fc26e36bb86831a4a3511bd4f /spec/functions/parseyaml_spec.rb
parent066c08f8362d53f0f30897cb8710d11260c726ea (diff)
parent2339ea8db67ac7ef02d707c2a6011ae50f5d82b5 (diff)
Merge remote-tracking branch 'origin/master' into leap_masterHEADmaster
Diffstat (limited to 'spec/functions/parseyaml_spec.rb')
-rwxr-xr-xspec/functions/parseyaml_spec.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/functions/parseyaml_spec.rb b/spec/functions/parseyaml_spec.rb
index fa947ca..c2a138c 100755
--- a/spec/functions/parseyaml_spec.rb
+++ b/spec/functions/parseyaml_spec.rb
@@ -18,21 +18,26 @@ describe 'parseyaml' do
and_return('just a string')
end
- it 'should be able to parse a YAML data with a Hash' do
+ it 'should be able to parse YAML data with a Hash' do
is_expected.to run.with_params("---\na: '1'\nb: '2'\n").
and_return({'a' => '1', 'b' => '2'})
end
- it 'should be able to parse a YAML data with an Array' do
+ it 'should be able to parse YAML data with an Array' do
is_expected.to run.with_params("---\n- a\n- b\n- c\n").
and_return(['a', 'b', 'c'])
end
- it 'should be able to parse a YAML data with a mixed structure' do
+ it 'should be able to parse YAML data with a mixed structure' do
is_expected.to run.with_params("---\na: '1'\nb: 2\nc:\n d:\n - :a\n - true\n - false\n").
and_return({'a' => '1', 'b' => 2, 'c' => {'d' => [:a, true, false]}})
end
+ it 'should be able to parse YAML data with a UTF8 and double byte characters' do
+ is_expected.to run.with_params("---\na: ×\nこれ: 記号\nです:\n ©:\n - Á\n - ß\n").
+ and_return({"a"=>"×", "これ"=>"記号", "です"=>{"©"=>["Á", "ß"]} })
+ end
+
it 'should not return the default value if the data was parsed correctly' do
is_expected.to run.with_params("---\na: '1'\n", 'default_value').
and_return({'a' => '1'})