class RSpec::CommandOption
Constants
- ARGS_OPTIONS
- NO_ARGS_OPTIONS
- OPTIONS
- VERSION
Public Class Methods
new(&block)
click to toggle source
# File lib/rspec/command_option.rb, line 12 def initialize(&block) block.call(self) if block end
Public Instance Methods
build()
click to toggle source
# File lib/rspec/command_option.rb, line 16 def build cmd = CommandBuilder.new(nil) # don't use command name NO_ARGS_OPTIONS.select {|opt| send(opt) }.map {|opt| cmd.argument(opt.to_s.gsub('_', '-')) } ARGS_OPTIONS.select {|opt| send(opt) }.map {|opt| cmd.argument(opt.to_s.gsub('_', '-'), send(opt)) } cmd.to_s.strip end
Also aliased as: to_s