Help us understand the problem. What is going on with this article?

phpunit autotest(using guard-shell)

More than 5 years have passed since last update.
$ vi Gemfile
source 'https://rubygems.org'
group :development do
  gem 'guard-shell'
  # Notify
  gem 'libnotify',  require: false
  gem 'rb-inotify', require: false
  gem 'rb-fsevent', require: false
  gem 'growl',      require: false
end
$ bundle
$ rbenv rehash
vi Guardfile
guard 'shell' do
  watch(%r{^protected/(models|components)/(.*)\.php$}){|m|
    testfile = "tests/unit/#{m[0]}/#{m[1]}Test.php"
    run_phpunit(testfile)
  }
  watch(%r{^tests/(.*)Test\.php$}){|m| run_phpunit(m[0]) }
end

def run_phpunit(filename)
  unless FileTest.exist?(filename)
    puts "\n>> Not found #{filename}"
    return
  end

  puts "\n>> run: #{filename}"
  result = `phpunit --bootstrap tests/bootstrap.php #{filename}`
  result =~ /\((.+test.?,.+assertion.?)\)/
  if success = $+
    n "#{success}", File.basename(filename)
    puts ">> passed: #{success}"
  else
    result =~ /(Tests:.+Assertions:.+Failures:.+)/
    failure = $+
    n "Failed", File.basename(filename)
    puts ">> failed"
    puts ">> Error report\n#{result}"
  end
end
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away