Sha256: 43835b7ed106ffde2a2c6209a531d8ea87e4d8ccf6bc811bf5b2af952d12b5e9

Contents?: true

Size: 923 Bytes

Versions: 2

Compression:

Stored size: 923 Bytes

Contents

require_relative '../test_helper'

class AutocukeTest < Test::Unit::TestCase

  def setup
    @bin = File.expand_path("../../../bin/autocuke", __FILE__)    
    @output = ""
  end

  def call(options)
    `#{@bin} #{options}`
  end
  
  should "have classes defined" do
    assert defined?(Autocuke)
    assert defined?(Autocuke::Runtime)
    assert defined?(Autocuke::Handler)
  end

  should "have executable" do
    assert File.exists?(@bin)
    assert File.executable?(@bin)    
  end
  
  context "Autocuke options" do
      
    should "display help" do
      @output = call("-h")
      assert @output.include?("Usage: autocuke [options]")
      %w(-r --root -d --dir -v --[no-]verbose -h --help --version).map{|i| assert @output.include?(i) }
    end
  
    should "display version and exit" do
      @output = call("--version")
      assert_equal "autocuke v#{Autocuke::VERSION}\n", @output
    end
  
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
autocuke-0.1.1 test/unit/autocuke_test.rb
autocuke-0.1.0 test/unit/autocuke_test.rb