Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stelligent/cfn_nag#416 Explicit encoding when reading files in rspec tests #76

Merged
6 commits merged into from
Mar 26, 2020
6 changes: 4 additions & 2 deletions spec/validator/cloudformation_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@

it 'raises an error when JSON contains UTF-8 characters' do
invalid_character_json = File.read(
'spec/test_templates/json/template_with_utf8_characters.json'
'spec/test_templates/json/template_with_utf8_characters.json',
encoding: Encoding::US_ASCII
)

expect do
Expand All @@ -72,7 +73,8 @@

it 'raises an error when YAML contains UTF-8 characters' do
invalid_character_template = File.read(
'spec/test_templates/yaml/template_with_utf8_characters.yml'
'spec/test_templates/yaml/template_with_utf8_characters.yml',
encoding: Encoding::US_ASCII
)

expect do
Expand Down