Sha256: d188ebf6afa3ac87b805691ca05bec696a8ec41c61be0b4c5fbbcd3ef394524d

Contents?: true

Size: 880 Bytes

Versions: 3

Compression:

Stored size: 880 Bytes

Contents

# encoding: utf-8
#
require 'spec_helper'

# We need to load the CLI file explicitly as the CLI is not loaded with the Loader (not needed in the server, only for script runs).
#
require File.expand_path '../../../lib/picky/cli', __FILE__

# TODO Finish this prototype Spec, redesign.
#
describe Picky::CLI do
  
  describe Picky::CLI::Base do
    before(:each) do
      @executor = Picky::CLI::Base.new
    end
    describe 'usage' do
      it 'calls puts with an usage' do
        @executor.should_receive(:puts).once.with "Usage\n  picky some_name <param1> <param 2 (optional)>"
        
        @executor.usage :some_name, [:param1, 'param 2 (optional)']
      end
    end
    describe 'params_to_s' do
      it 'returns the right string' do
        @executor.params_to_s([:param1, 'param 2 (optional)']).should == '<param1> <param 2 (optional)>'
      end
    end
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
picky-1.2.3 spec/lib/cli_spec.rb
picky-1.2.2 spec/lib/cli_spec.rb
picky-1.2.1 spec/lib/cli_spec.rb