Sha256: 143cdfc943eb53375712f7bb9ddc68006cbdc5f6f541b5b109c086dbc589438b

Contents?: true

Size: 881 Bytes

Versions: 9

Compression:

Stored size: 881 Bytes

Contents

require 'spec_helper'

describe <%= app_name.camelize %>::Command::Base do
  context 'given a list of options' do
    let(:command) { <%= app_name.camelize %>::Command::Base.new }

    it 'responds successfully to help, version and generate' do
      [:help, :version].each do |element|
        expect(command).to respond_to element
      end
    end
  end

  describe 'given a help option' do
    before do
      @help = capture_stdout do
        <%= app_name.camelize %>::Command::Base.help(Thor::Base.shell.new)
      end
    end

    it 'shows help info' do
      expect(@help).to match(/help/)
    end
  end

  describe 'given a version option' do
    before do
      @version = capture_stdout do
        <%= app_name.camelize %>::Command::Base.start %W[ version ]
      end
    end

    it 'shows version info' do
      expect(@version).to match(/version/)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rgentpl-1.0.9 src/spec/lib/%app_name%/command/base_spec.rb.tt
rgentpl-1.0.8 src/spec/lib/%app_name%/command/base_spec.rb.tt
rgentpl-1.0.7 src/spec/lib/%app_name%/command/base_spec.rb.tt
rgentpl-1.0.6 src/spec/lib/%app_name%/command/base_spec.rb.tt
rgentpl-1.0.5 src/spec/lib/%app_name%/command/base_spec.rb.tt
rgentpl-1.0.4 src/spec/lib/%app_name%/command/base_spec.rb.tt
rgentpl-1.0.3 src/spec/lib/%app_name%/command/base_spec.rb.tt
rgentpl-1.0.2 src/spec/lib/%app_name%/command/base_spec.rb.tt
rgentpl-1.0.1 src/spec/lib/%app_name%/command/base_spec.rb.tt