Sha256: eb608724f1d216040c137ea5fe3337ed6882b5ac8f06586161dc5a49b257dd2b

Contents?: true

Size: 637 Bytes

Versions: 2

Compression:

Stored size: 637 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'system_builder/cli'

describe SystemBuilder::CLI, "execute" do

  class ExitException < Exception; end;

  before(:each) do
    SystemBuilder::CLI.stub!(:exit).and_raise(ExitException)
  end

  def system_builder(*arguments)
    @stdout_io = StringIO.new

    begin
      SystemBuilder::CLI.execute(@stdout_io, arguments.flatten)
    rescue ExitException

    end

    @stdout_io.rewind
    @stdout = @stdout_io.read
  end
  
  it "should print default output" do
    system_builder "--help"
    @stdout.should =~ /Usage: .* \[options\] image command/
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
system-builder-0.0.4 spec/system-builder_cli_spec.rb
system-builder-0.0.3 spec/system-builder_cli_spec.rb