Sha256: 9fe7096352c8bd5694de926aa45da2b2ee409569e80800aa193e0d3957b7d40a

Contents?: true

Size: 964 Bytes

Versions: 1

Compression:

Stored size: 964 Bytes

Contents

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

class TestAutotestforphpCli < Test::Unit::TestCase
  def setup
    @atp = Autotestforphp
  end

  def test_default_folders_to_watch
    @atp.expects(:run).
      with(["./src/**/*", "./test/**/*", "./app/**/*", "./lib/**/*"]).
      once

    execute
  end

  def test_loads_folders_from_config
    @atp.const_set :FOLDERS_TO_WATCH, ["./src/**/*"]
    @atp.expects(:run).
      with(["./src/**/*"]).
      once
    
    execute
  end

  def test_print_message_after_installation
    Autotestforphp.expects(:install).
                   once

    execute(['--install'])

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

  def execute(args = [])
    Autotestforphp::CLI.execute(@stdout_io = StringIO.new, args)
    @stdout_io.rewind
    @stdout = @stdout_io.read
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
autotestforphp-0.0.3 test/cli/test_autotestforphp_cli.rb