diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4957cc4aab4..2a6c60a79ad 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -254,6 +254,7 @@ specs: AWS_REGION: us-west-2 AWS_SECRET_ACCESS_KEY: test CAPYBARA_WAIT_TIME_SECONDS: 5 + RUBYOPT: '--enable=frozen-string-literal' COVERAGE: 'true' DOCKER_DB_HOST: db-postgres POSTGRES_DB: identity_idp_test diff --git a/spec/bin/aamva-test-cert_spec.rb b/spec/bin/aamva-test-cert_spec.rb index 12658ac3abc..5a5b604cc47 100644 --- a/spec/bin/aamva-test-cert_spec.rb +++ b/spec/bin/aamva-test-cert_spec.rb @@ -16,7 +16,7 @@ def test_cert(auth_url:, verification_url:) describe '#run' do subject(:run) { instance.run(out: out, argv: argv) } - let(:out) { StringIO.new('') } + let(:out) { StringIO.new(+'') } let(:argv) { [] } context 'missing arguments' do diff --git a/spec/requests/headers_spec.rb b/spec/requests/headers_spec.rb index bbf84a83e92..d6dba349a6e 100644 --- a/spec/requests/headers_spec.rb +++ b/spec/requests/headers_spec.rb @@ -26,7 +26,7 @@ end it 'does not raise an error when HTTP_HOST Header is encoded with ASCII-8BIT' do - get root_path, headers: { 'Host' => '¿’¿”'.force_encoding(Encoding::ASCII_8BIT) } + get root_path, headers: { 'Host' => (+'¿’¿”').force_encoding(Encoding::ASCII_8BIT) } expect(response.status).to eq 200 end diff --git a/spec/services/barcode_outputter_spec.rb b/spec/services/barcode_outputter_spec.rb index f0ef078dded..e6a2a0289b9 100644 --- a/spec/services/barcode_outputter_spec.rb +++ b/spec/services/barcode_outputter_spec.rb @@ -9,7 +9,7 @@ it 'returns image data' do # See: https://en.wikipedia.org/wiki/List_of_file_signatures - png_signature = "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a".force_encoding(Encoding::ASCII_8BIT) + png_signature = (+"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a").force_encoding(Encoding::ASCII_8BIT) expect(image_data).to start_with(png_signature) end end diff --git a/spec/services/encrypted_redis_struct_storage_spec.rb b/spec/services/encrypted_redis_struct_storage_spec.rb index 0841541d3b5..d1db1842fcd 100644 --- a/spec/services/encrypted_redis_struct_storage_spec.rb +++ b/spec/services/encrypted_redis_struct_storage_spec.rb @@ -143,7 +143,7 @@ def self.redis_key_prefix context 'with funky ASCII data inside the struct' do let(:data) do - "HTTP Status 401 \xE2\x80\x93 Unauthorized".force_encoding('ASCII-8BIT').freeze + (+"HTTP Status 401 \xE2\x80\x93 Unauthorized").force_encoding('ASCII-8BIT').freeze end it 'converts the data and stores it' do