Sha256: 7bf1acf4d6f1cbd29012aa9bc0e30f044d5588cf613fc6f84306c28fab73da24

Contents?: true

Size: 1010 Bytes

Versions: 51

Compression:

Stored size: 1010 Bytes

Contents

require File.expand_path(File.join(__FILE__, '..', 'test_helper'))

class CommandTest < Test::Unit::TestCase

  def setup
    @project_root = File.expand_path(File.join(__FILE__, '../..'))
    @rubber = "#{@project_root}/bin/rubber"
    ENV['RUBBER_ROOT'] = @project_root
  end
  
  def test_rubber_help
    out = `#{@rubber}`
    assert out =~ /Subcommands:\n(.*)\nOptions:/m
    subcommands = $1.scan(/^\s*(\S+)\s*/).flatten
    assert_equal ["config", "cron", "util:rotate_logs", "util:backup", "util:backup_db", "util:obfuscation", "util:restore_db", "vulcanize"].sort, subcommands.sort
  end

  def test_rubber_help_size
    out = `#{@rubber} --help`
    assert out.lines.all? {|l| l.size <= 81 }
    
    assert out =~ /Subcommands:\n(.*)\nOptions:/m
    subcommands = $1.scan(/^\s*(\S+)\s*/).flatten
    assert subcommands.size > 0
    subcommands.each do |s|
      out = `#{@rubber} #{s} --help`
      assert out.lines.all? {|l| l.size <= 81 }, "help for #{s} exceeds 80 chars"
    end
  
  end
  
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
rubber-3.2.2 test/command_test.rb
rubber-3.2.1 test/command_test.rb
rubber-3.2.0 test/command_test.rb
rubber-3.1.0 test/command_test.rb
rubber-3.0.1 test/command_test.rb
rubber-3.0.0 test/command_test.rb
rubber-2.16.0 test/command_test.rb
rubber-2.15.2 test/command_test.rb
rubber-2.15.1 test/command_test.rb
rubber-2.15.0 test/command_test.rb
rubber-2.14.0 test/command_test.rb
rubber-2.13.1 test/command_test.rb
rubber-2.13.0 test/command_test.rb
rubber-2.12.2 test/command_test.rb
rubber-2.12.1 test/command_test.rb
rubber-2.12.0 test/command_test.rb
rubber-2.11.0 test/command_test.rb
rubber-2.10.2 test/command_test.rb
rubber-2.10.1 test/command_test.rb
rubber-2.10.0 test/command_test.rb