Sha256: 8085eb8c317c407f65e4ab12c26104ce7d82b7dca4b38aedfbead8c5d7401fbf

Contents?: true

Size: 1.24 KB

Versions: 6

Compression:

Stored size: 1.24 KB

Contents

require 'fileutils'

require 'gooddata/cli/cli'

describe 'GoodData::CLI - scaffold' do
  TEST_PROJECT_NAME = 'test-project'
  TEST_BRICK_NAME = 'test-brick'

  describe 'scaffold' do
    it 'Complains when no subcommand specified' do
      args = %w(scaffold)

      out = run_cli(args)
      out.should include "Command 'scaffold' requires a subcommand project,brick"
    end
  end

  describe 'scaffold brick' do
    it 'Complains when brick name is not specified' do
      args = %w(scaffold brick)

      out = run_cli(args)
      out.should include 'Name of the brick has to be provided'
    end

    it 'Scaffolds brick if the name is specified' do
      args = [
        'scaffold',
        'brick',
        TEST_BRICK_NAME
      ]

      run_cli(args)
      FileUtils.rm_rf(TEST_BRICK_NAME)
    end
  end

  describe 'scaffold project' do
    it 'Complains when project name is not specified' do
      args = %w(scaffold project)

      out = run_cli(args)
      out.should include 'Name of the project has to be provided'
    end

    it "Scaffolds project if the name is specified" do
      args = [
        'scaffold',
        'project',
        TEST_PROJECT_NAME
      ]

      run_cli(args)
      FileUtils.rm_rf(TEST_PROJECT_NAME)
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gooddata-0.6.7 spec/unit/cli/commands/cmd_scaffold_spec.rb
gooddata-0.6.6 spec/unit/cli/commands/cmd_scaffold_spec.rb
gooddata-0.6.5 spec/unit/cli/commands/cmd_scaffold_spec.rb
gooddata-0.6.4 spec/unit/cli/commands/cmd_scaffold_spec.rb
gooddata-0.6.3 spec/unit/cli/commands/cmd_scaffold_spec.rb
gooddata-0.6.2 spec/unit/cli/commands/cmd_scaffold_spec.rb