diff --git a/spec/classes/rabbitmq_spec.rb b/spec/classes/rabbitmq_spec.rb index 8c9b39a26..044c31e4c 100644 --- a/spec/classes/rabbitmq_spec.rb +++ b/spec/classes/rabbitmq_spec.rb @@ -19,7 +19,7 @@ describe 'apt::source default values' do let(:facts) {{ :osfamily => 'Debian' }} it 'should add a repo with defaults values' do - contain_file('/etc/apt/sources.list.d/rabbitmq.list')\ + should contain_file('/etc/apt/sources.list.d/rabbitmq.list')\ .with_content(%r|deb http\://www\.rabbitmq.com/debian/ testing main|) end end @@ -31,7 +31,7 @@ :repos => 'main' }} it 'should add a repo with custom new values' do - contain_file('/etc/apt/sources.list.d/rabbitmq.list')\ + should contain_file('/etc/apt/sources.list.d/rabbitmq.list')\ .with_content(%r|deb http\://www\.foorepo.com/debian/ unstable main|) end end @@ -235,7 +235,7 @@ describe 'node_ip_address when set' do let(:params) {{ :node_ip_address => '172.0.0.1' }} it 'should set RABBITMQ_NODE_IP_ADDRESS to specified value' do - contain_file('rabbitmq-env.config').with({ + should contain_file('rabbitmq-env.config').with({ 'content' => 'RABBITMQ_NODE_IP_ADDRESS=172.0.0.1', }) end @@ -243,23 +243,23 @@ describe 'stomp by default' do it 'should not specify stomp parameters in rabbitmq.config' do - contain_file('rabbitmq.config').without({ + should contain_file('rabbitmq.config').without({ 'content' => /stomp/,}) end end describe 'stomp when set' do let(:params) {{ :config_stomp => true, :stomp_port => 5679 }} it 'should specify stomp port in rabbitmq.config' do - contain_file('rabbitmq.config').with({ - 'content' => /rabbitmq_stomp.*tcp_listeners, \[5679\]/, + should contain_file('rabbitmq.config').with({ + 'content' => /rabbitmq_stomp.*tcp_listeners, \[5679\]/m, }) end end describe 'stomp when set with ssl' do let(:params) {{ :config_stomp => true, :stomp_port => 5679, :ssl_stomp_port => 5680 }} it 'should specify stomp port and ssl stomp port in rabbitmq.config' do - contain_file('rabbitmq.config').with({ - 'content' => /rabbitmq_stomp.*tcp_listeners, \[5679\].*ssl_listeners, \[5680\]/, + should contain_file('rabbitmq.config').with({ + 'content' => /rabbitmq_stomp.*tcp_listeners, \[5679\].*ssl_listeners, \[5680\]/m, }) end end @@ -316,8 +316,8 @@ describe 'default_user and default_pass set' do let(:params) {{ :default_user => 'foo', :default_pass => 'bar' }} it 'should set default_user and default_pass to specified values' do - contain_file('rabbitmq.config').with({ - 'content' => /default_user, <<"foo">>.*default_pass, <<"bar">>/, + should contain_file('rabbitmq.config').with({ + 'content' => /default_user, <<"foo">>.*default_pass, <<"bar">>/m, }) end end @@ -332,7 +332,7 @@ } } it 'should set ssl options to specified values' do - contain_file('rabbitmq.config').with({ + should contain_file('rabbitmq.config').with({ 'content' => %r|ssl_listeners, \[3141\].* ssl_options, \[\{cacertfile,"/path/to/cacert".* certfile="/path/to/cert".* @@ -352,7 +352,7 @@ } } it 'should set ssl options to specified values' do - contain_file('rabbitmq.config').with({ + should contain_file('rabbitmq.config').with({ 'content' => %r|tcp_listeners, \[\].* ssl_listeners, \[3141\].* ssl_options, \[\{cacertfile,"/path/to/cacert".* @@ -373,7 +373,7 @@ } } it 'should set rabbitmq_management ssl options to specified values' do - contain_file('rabbitmq.config').with({ + should contain_file('rabbitmq.config').with({ 'content' => %r|\{rabbitmq_management, \[.* \{listener, \[.* \{port, 3141\},.* @@ -394,11 +394,11 @@ } } it 'should set rabbitmq_management options to specified values' do - contain_file('rabbitmq.config').with({ + should contain_file('rabbitmq.config').with({ 'content' => /\{rabbitmq_management, \[.* \{listener, \[.* \{port, 3141\},.* - \]\}/, + \]\}/m, }) end end @@ -414,7 +414,7 @@ } } it 'should set rabbitmq_management ssl options to specified values' do - contain_file('rabbitmq.config').with({ + should contain_file('rabbitmq.config').with({ 'content' => %r|\{rabbitmq_management, \[.* \{listener, \[.* \{port, 3141\},.* @@ -435,11 +435,11 @@ } } it 'should set rabbitmq_management options to specified values' do - contain_file('rabbitmq.config').with({ + should contain_file('rabbitmq.config').with({ 'content' => /\{rabbitmq_management, \[.* \{listener, \[.* \{port, 3141\},.* - \]\}/, + \]\}/m, }) end end