1 require 'spec_helper_acceptance'
2 require 'beaker/i18n_helper'
4 PUPPETLABS_GPG_KEY_LONG_ID = '7F438280EF8D349F'.freeze
5 PUPPETLABS_LONG_FINGERPRINT = '123456781274D2C8A956789A456789A456789A9A'.freeze
7 id_doesnt_match_fingerprint_pp = <<-MANIFEST
8 apt_key { '#{PUPPETLABS_LONG_FINGERPRINT}':
10 content => '123456781274D2C8A956789A456789A456789A9B',
14 location_not_specified_fail_pp = <<-MANIFEST
15 apt::source { 'puppetlabs':
19 id => '6F6B15509CF8E59E6E469F327F438280EF8D349F',
20 server => 'hkps.pool.sks-keyservers.net',
25 invalid_title_pp = <<-MANIFEST
26 apt::setting { 'test':
32 no_content_param_pp = <<-MANIFEST
38 describe 'localization', if: (fact('osfamily') == 'Debian' || fact('osfamily') == 'RedHat') && (Gem::Version.new(puppet_version) >= Gem::Version.new('4.10.5')) do
41 on(host, "sed -i \"96i FastGettext.locale='ja'\" /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb")
42 change_locale_on(host, 'ja_JP.utf-8')
46 describe 'ruby translations' do
47 it 'translates an interpolated string' do
48 apply_manifest(id_doesnt_match_fingerprint_pp, expect_failures: true) do |r|
49 expect(r.stderr).to match(%r{content/sourceが正当であるかを確認してください})
52 it 'translates a simple string' do
53 apply_manifest(location_not_specified_fail_pp, expect_failures: true) do |r|
54 expect(r.stderr).to match(%r{場所を指定せずにソースエントリを作成することはできません})
59 describe 'puppet translations' do
60 it 'translates a concatenated string' do
61 apply_manifest(invalid_title_pp, expect_failures: true) do |r|
62 expect(r.stderr).to match(%r{apt::settingのリソース名/タイトルの先頭は、'conf-'、'pref-'、'list-'にする必要があります})
65 it 'translates a simple string' do
66 apply_manifest(no_content_param_pp, expect_failures: true) do |r|
67 expect(r.stderr).to match(%r{contentパラメータを渡す必要があります})
74 on(host, 'sed -i "96d" /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb')
75 change_locale_on(host, 'en_US')