Sha256: 19d487f080519ec484a4b6a20255d1e8da57fa1490e76ba3108b0b778db0d93e

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

require File.join(File.dirname(__FILE__), '..', "test_helper.rb")
require 'autotestforphp/cli'

class TestInstallCli < Test::Unit::TestCase
  def setup
    @atp = Autotestforphp.new
    @atp.base_path = File.dirname(__FILE__) + '/'

    Dir.mkdir("#{@atp.base_path}test/") unless File.exist?("#{@atp.base_path}test/")

    Autotestforphp::CLI.execute(@stdout_io = StringIO.new, ['--install'])
    @stdout_io.rewind
    @stdout = @stdout_io.read
  end

  def teardown
    File.delete(@atp.bootstrap_file_path) if File.exist?(@atp.bootstrap_file_path)
    File.delete(@atp.phpunit_config_file_path) if File.exist?(@atp.phpunit_config_file_path)
    File.delete(@atp.config_file_path) if File.exist?(@atp.config_file_path)
    Dir.delete("#{@atp.base_path}autotestforphp/") if File.exist?("#{@atp.base_path}autotestforphp/")
    Dir.delete("#{@atp.base_path}test/") if File.exist?("#{@atp.base_path}test/")
  end

  def test_print_default_output
    assert_match(/Autotest for PHP was installed successfully/, @stdout)
  end

  def test_create_files
    assert @atp.phpunit_config_file_exists?
    assert @atp.bootstrap_file_exists?
    assert @atp.config_file_exists?
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fgrehm-autotestforphp-0.0.1 test/cli/test_install_cli.rb