spec/cronicle_update_spec.rb in cronicle-0.1.1 vs spec/cronicle_update_spec.rb in cronicle-0.1.2

- old
+ new

@@ -1,33 +1,33 @@ describe 'Cronicle::Client#apply (update)' do before do on TARGET_HOSTS do |ssh_options| user = ssh_options[:user] - set_crontab user, <<-CRON.undent + set_crontab user, <<-CRON.unindent FOO=bar ZOO=baz 1 1 1 1 1 echo #{user} > /dev/null CRON - set_crontab :root, <<-CRON.undent + set_crontab :root, <<-CRON.unindent FOO=bar ZOO=baz 1 1 1 1 1 echo root > /dev/null CRON end - cronicle(:apply) { <<-RUBY.undent } + cronicle(:apply) { <<-RUBY.unindent } on servers: /.*/ do job :foo, user: :root, schedule: '1 2 * * *' do puts `uname` puts `whoami` end end on servers: /.*/ do - job :bar, user: :root, schedule: :@hourly, content: <<-SH.undent + job :bar, user: :root, schedule: :@hourly, content: <<-SH.unindent #!/bin/sh echo hello SH end @@ -80,20 +80,20 @@ " } end let(:jobfile) do - <<-RUBY.undent + <<-RUBY.unindent on servers: /.*/ do job :foo, user: :root, schedule: '1 2 * * *' do puts `uname` #puts `whoami` end end on servers: /.*/ do - job :bar, user: :root, schedule: :@hourly, content: <<-SH.undent + job :bar, user: :root, schedule: :@hourly, content: <<-SH.unindent #!/bin/sh echo hello SH end @@ -151,43 +151,43 @@ it do on :amazon_linux do expect(get_uname).to match /amzn/ expect(get_crontabs).to eq amzn_crontab_orig - expect(get_file('/var/lib/cronicle/libexec/root/foo')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/root/foo')).to eq <<-EOS.unindent #!/usr/bin/env ruby puts `uname` puts `whoami` EOS - expect(get_file('/var/lib/cronicle/libexec/root/bar')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/root/bar')).to eq <<-EOS.unindent #!/bin/sh echo hello EOS - expect(get_file('/var/lib/cronicle/libexec/ec2-user/foo')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/ec2-user/foo')).to eq <<-EOS.unindent #!/usr/bin/env ruby puts 100 EOS end on :ubuntu do expect(get_uname).to match /Ubuntu/ expect(get_crontabs).to eq ubuntu_crontab_orig - expect(get_file('/var/lib/cronicle/libexec/root/foo')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/root/foo')).to eq <<-EOS.unindent #!/usr/bin/env ruby puts `uname` puts `whoami` EOS - expect(get_file('/var/lib/cronicle/libexec/root/bar')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/root/bar')).to eq <<-EOS.unindent #!/bin/sh echo hello EOS - expect(get_file('/var/lib/cronicle/libexec/ubuntu/foo')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/ubuntu/foo')).to eq <<-EOS.unindent #!/usr/bin/env ruby puts 200 EOS end @@ -195,43 +195,43 @@ on :amazon_linux do expect(get_uname).to match /amzn/ expect(get_crontabs).to eq amzn_crontab - expect(get_file('/var/lib/cronicle/libexec/root/foo')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/root/foo')).to eq <<-EOS.unindent #!/usr/bin/env ruby puts `uname` #puts `whoami` EOS - expect(get_file('/var/lib/cronicle/libexec/root/bar')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/root/bar')).to eq <<-EOS.unindent #!/bin/sh echo hello EOS - expect(get_file('/var/lib/cronicle/libexec/ec2-user/foo')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/ec2-user/foo')).to eq <<-EOS.unindent #!/usr/bin/env ruby puts 100 EOS end on :ubuntu do expect(get_uname).to match /Ubuntu/ expect(get_crontabs).to eq ubuntu_crontab - expect(get_file('/var/lib/cronicle/libexec/root/foo')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/root/foo')).to eq <<-EOS.unindent #!/usr/bin/env ruby puts `uname` #puts `whoami` EOS - expect(get_file('/var/lib/cronicle/libexec/root/bar')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/root/bar')).to eq <<-EOS.unindent #!/bin/sh echo hello EOS - expect(get_file('/var/lib/cronicle/libexec/ubuntu/foo2')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/ubuntu/foo2')).to eq <<-EOS.unindent #!/usr/bin/env ruby puts 200 EOS end end @@ -277,43 +277,43 @@ it do on :amazon_linux do expect(get_uname).to match /amzn/ expect(get_crontabs).to eq amzn_crontab_orig - expect(get_file('/var/lib/cronicle/libexec/root/foo')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/root/foo')).to eq <<-EOS.unindent #!/usr/bin/env ruby puts `uname` puts `whoami` EOS - expect(get_file('/var/lib/cronicle/libexec/root/bar')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/root/bar')).to eq <<-EOS.unindent #!/bin/sh echo hello EOS - expect(get_file('/var/lib/cronicle/libexec/ec2-user/foo')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/ec2-user/foo')).to eq <<-EOS.unindent #!/usr/bin/env ruby puts 100 EOS end on :ubuntu do expect(get_uname).to match /Ubuntu/ expect(get_crontabs).to eq ubuntu_crontab_orig - expect(get_file('/var/lib/cronicle/libexec/root/foo')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/root/foo')).to eq <<-EOS.unindent #!/usr/bin/env ruby puts `uname` puts `whoami` EOS - expect(get_file('/var/lib/cronicle/libexec/root/bar')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/root/bar')).to eq <<-EOS.unindent #!/bin/sh echo hello EOS - expect(get_file('/var/lib/cronicle/libexec/ubuntu/foo')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/ubuntu/foo')).to eq <<-EOS.unindent #!/usr/bin/env ruby puts 200 EOS end @@ -321,42 +321,42 @@ on :amazon_linux do expect(get_uname).to match /amzn/ expect(get_crontabs).to eq amzn_crontab_orig - expect(get_file('/var/lib/cronicle/libexec/root/foo')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/root/foo')).to eq <<-EOS.unindent #!/usr/bin/env ruby puts `uname` puts `whoami` EOS - expect(get_file('/var/lib/cronicle/libexec/root/bar')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/root/bar')).to eq <<-EOS.unindent #!/bin/sh echo hello EOS - expect(get_file('/var/lib/cronicle/libexec/ec2-user/foo')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/ec2-user/foo')).to eq <<-EOS.unindent #!/usr/bin/env ruby puts 100 EOS end on :ubuntu do expect(get_uname).to match /Ubuntu/ expect(get_crontabs).to eq ubuntu_crontab_orig - expect(get_file('/var/lib/cronicle/libexec/root/foo')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/root/foo')).to eq <<-EOS.unindent #!/usr/bin/env ruby puts `uname` puts `whoami` EOS - expect(get_file('/var/lib/cronicle/libexec/root/bar')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/root/bar')).to eq <<-EOS.unindent #!/bin/sh echo hello EOS - expect(get_file('/var/lib/cronicle/libexec/ubuntu/foo')).to eq <<-EOS.undent + expect(get_file('/var/lib/cronicle/libexec/ubuntu/foo')).to eq <<-EOS.unindent #!/usr/bin/env ruby puts 200 EOS end end