Sha256: 2a7a2bbe7fc3c4aaf6e80fe1574c125f9a71c4e71ae009001697fcff76053039

Contents?: true

Size: 719 Bytes

Versions: 2

Compression:

Stored size: 719 Bytes

Contents

require File.dirname(__FILE__) + '/helper'
require 'thor/group'
require 'fakeweb'

class TestCli < Test::Unit::TestCase
  def setup
    FakeWeb.allow_net_connect = false
    `rm -rf /tmp/sample_project`
    @cli     = Padrino::Generators::Cli.dup
    @project = Padrino::Generators::Project.dup
  end

  context 'the cli' do

    should "fail without arguments" do
      output = silence_logger { @cli.start }
      assert_match "Please specify generator to use", output
    end

    should "work correctly if we have a project" do
      silence_logger { @project.start(['sample_project', '--root=/tmp']) }
      assert_nothing_raised { silence_logger { @cli.start(['--root=/tmp/sample_project']) } }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
padrino-gen-0.8.1 test/test_cli.rb
padrino-gen-0.8.0 test/test_cli.rb