Sha256: 6d64c2595906d48869945b26e769465e2e233e8972b5c248cf3958e4b005860b

Contents?: true

Size: 924 Bytes

Versions: 3

Compression:

Stored size: 924 Bytes

Contents

require 'test_helper'

class CommandLineTest < Minitest::Test
  
  context "A CloudCrowd::CommandLine" do
    
    should "install into the directory that you ask it to" do
      dir = 'tmp/test_install_dir'
      ARGV.replace ['install', dir]
      CloudCrowd::CommandLine.new
      assert File.exists?(dir)
      assert File.directory?(dir)
      CloudCrowd::CommandLine::CONFIG_FILES.each do |file|
        assert File.exists?("#{dir}/#{file}")
      end
      FileUtils.rm_r(dir)
    end
    
    should "mix in CloudCrowd to the top level of `crowd console` sessions" do
      require 'irb'
      ARGV.replace ['-c', 'test/config', 'console']
      IRB.expects(:start)
      CloudCrowd::CommandLine.new
      ['Job', 'WorkUnit', 'Server', 'Node', 'SUCCEEDED', 'FAILED'].each do |constant|
        assert Object.constants.include?(constant.to_sym), "CommandLine includes #{constant}"
      end
    end
    
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cloud-crowd-0.7.6 test/unit/test_command_line.rb
cloud-crowd-0.7.5 test/unit/test_command_line.rb
cloud-crowd-0.7.3 test/unit/test_command_line.rb