test/deploying/test_git.rb in nanoc-4.7.9 vs test/deploying/test_git.rb in nanoc-4.7.10
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
class Nanoc::Deploying::Deployers::GitTest < Nanoc::TestCase
def test_run_with_defaults_options
# Create deployer
git = Nanoc::Deploying::Deployers::Git.new(
'output/',
@@ -22,16 +24,16 @@
Dir.chdir('output') { system('git', 'init', '--quiet') }
# Try running
git.run
- commands = <<-EOS
-git config --get remote.origin.url
-git checkout master
-git add -A
-git commit -a --author Nanoc <> -m Automated commit at .+ by Nanoc \\d+\\.\\d+\\.\\d+\\w*
-git push origin master
+ commands = <<~EOS
+ git config --get remote.origin.url
+ git checkout master
+ git add -A
+ git commit -a --author Nanoc <> -m Automated commit at .+ by Nanoc \\d+\\.\\d+\\.\\d+\\w*
+ git push origin master
EOS
assert_match Regexp.new(/^#{commands.chomp}$/), git.instance_eval { @shell_cmd_args.join("\n") }
end
@@ -58,13 +60,13 @@
Dir.chdir('output') { system('git', 'init', '--quiet') }
# Try running
git.run
- commands = <<-EOS
-git config --get remote.origin.url
-git checkout master
+ commands = <<~EOS
+ git config --get remote.origin.url
+ git checkout master
EOS
assert_match Regexp.new(/^#{commands.chomp}$/), git.instance_eval { @shell_cmd_args.join("\n") }
end
@@ -91,16 +93,16 @@
Dir.chdir('output') { system('git', 'init', '--quiet') }
# Try running
git.run
- commands = <<-EOS
-git config --get remote.github.url
-git checkout gh-pages
-git add -A
-git commit -a --author Nanoc <> -m Automated commit at .+ by Nanoc \\d+\\.\\d+\\.\\d+\\w*
-git push -f github gh-pages
+ commands = <<~EOS
+ git config --get remote.github.url
+ git checkout gh-pages
+ git add -A
+ git commit -a --author Nanoc <> -m Automated commit at .+ by Nanoc \\d+\\.\\d+\\.\\d+\\w*
+ git push -f github gh-pages
EOS
assert_match Regexp.new(/^#{commands.chomp}$/), git.instance_eval { @shell_cmd_args.join("\n") }
end
@@ -126,16 +128,16 @@
FileUtils.mkdir_p('output/.git')
# Try running
git.run
- commands = <<-EOS
-git config --get remote.origin.url
-git checkout master
-git add -A
-git commit -a --author Nanoc <> -m Automated commit at .+ by Nanoc \\d+\\.\\d+\\.\\d+\\w*
-git push origin master
+ commands = <<~EOS
+ git config --get remote.origin.url
+ git checkout master
+ git add -A
+ git commit -a --author Nanoc <> -m Automated commit at .+ by Nanoc \\d+\\.\\d+\\.\\d+\\w*
+ git push origin master
EOS
assert_match Regexp.new(/^#{commands.chomp}$/), git.instance_eval { @shell_cmd_args.join("\n") }
end
@@ -162,15 +164,15 @@
Dir.chdir('output') { system('git', 'init', '--quiet') }
# Try running
git.run
- commands = <<-EOS
-git checkout master
-git add -A
-git commit -a --author Nanoc <> -m Automated commit at .+ by Nanoc \\d+\\.\\d+\\.\\d+\\w*
-git push git@github.com:myself/myproject.git master
+ commands = <<~EOS
+ git checkout master
+ git add -A
+ git commit -a --author Nanoc <> -m Automated commit at .+ by Nanoc \\d+\\.\\d+\\.\\d+\\w*
+ git push git@github.com:myself/myproject.git master
EOS
assert_match Regexp.new(/^#{commands.chomp}$/), git.instance_eval { @shell_cmd_args.join("\n") }
end
@@ -197,14 +199,14 @@
Dir.chdir('output') { system('git', 'init', '--quiet') }
# Try running
git.run
- commands = <<-EOS
-git checkout master
-git add -A
-git commit -a --author Nanoc <> -m Automated commit at .+ by Nanoc \\d+\\.\\d+\\.\\d+\\w*
-git push https://github.com/nanoc/nanoc.git master
+ commands = <<~EOS
+ git checkout master
+ git add -A
+ git commit -a --author Nanoc <> -m Automated commit at .+ by Nanoc \\d+\\.\\d+\\.\\d+\\w*
+ git push https://github.com/nanoc/nanoc.git master
EOS
assert_match Regexp.new(/^#{commands.chomp}$/), git.instance_eval { @shell_cmd_args.join("\n") }
end