Sha256: 864a1c1a9ce68a47cb1fc4bf777f1dda3719dd8fbde5d160c2eaa196e8afd45a
Contents?: true
Size: 958 Bytes
Versions: 3
Compression:
Stored size: 958 Bytes
Contents
require 'commander' require 'stringio' # Mock terminal IO streams so we can spec against them def mock_terminal @input = StringIO.new @output = StringIO.new $terminal = HighLine.new @input, @output end # Create test command for usage within several specs def create_test_command command :test do |c| c.syntax = "test [options] <file>" c.description = "test description" c.example "description", "command" c.example "description 2", "command 2" c.option "-t", "--trace", "trace description" c.option "--verbose", "verbose description" c.when_called do |args, options| "test %s" % args.join end end @command = command :test end # Create a new global command runner def new_command_runner *args, &block $command_runner = Commander::Runner.new args program :name, 'test' program :version, '1.2.3' program :description, 'something' create_test_command yield if block_given? command_runner end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
visionmedia-commander-3.0.0 | spec/spec_helper.rb |
visionmedia-commander-3.0.1 | spec/spec_helper.rb |
visionmedia-commander-3.0.2 | spec/spec_helper.rb |