Sha256: cab23a52aeeb93cf064e10bb7ac13caa67012a5d0355cb4eac4b734364c9dfd7

Contents?: true

Size: 728 Bytes

Versions: 12

Compression:

Stored size: 728 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/helper')
require 'padrino-gen/generators/cli'

class TestCli < Test::Unit::TestCase
  def setup
    @apptmp = "#{Dir.tmpdir}/padrino-tests/#{UUID.new.generate}"
    `mkdir -p #{@apptmp}`
  end

  def teardown
    `rm -rf #{@apptmp}`
  end

  context 'the cli' do

    should "fail without arguments" do
      output = silence_logger { generate(:cli) }
      assert_match "Please specify generator to use", output
    end

    should "work correctly if we have a project" do
      silence_logger { generate(:project, 'sample_project', "--root=#{@apptmp}") }
      assert_nothing_raised { silence_logger { generate(:cli, "--root=#{@apptmp}/sample_project") } }
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
padrino-gen-0.10.1 test/test_cli.rb
padrino-gen-0.10.0 test/test_cli.rb
padrino-gen-0.9.29 test/test_cli.rb
padrino-gen-0.9.28 test/test_cli.rb
padrino-gen-0.9.27 test/test_cli.rb
padrino-gen-0.9.26 test/test_cli.rb
padrino-gen-0.9.24 test/test_cli.rb
padrino-gen-0.9.25 test/test_cli.rb
padrino-gen-0.9.23 test/test_cli.rb
padrino-gen-0.9.22 test/test_cli.rb
padrino-gen-0.9.21 test/test_cli.rb
padrino-gen-0.9.20 test/test_cli.rb