Class: RSpec::Core::CommandLineConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/core/command_line_configuration.rb

Defined Under Namespace

Classes: Autotest

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cmd) ⇒ CommandLineConfiguration

Returns a new instance of CommandLineConfiguration.



6
7
8
# File 'lib/rspec/core/command_line_configuration.rb', line 6

def initialize(cmd)
  @command = cmd
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



4
5
6
# File 'lib/rspec/core/command_line_configuration.rb', line 4

def command
  @command
end

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/rspec/core/command_line_configuration.rb', line 10

def run
  case @command
  when 'autotest' then Autotest.generate
  else raise ArgumentError, <<-MESSAGE

#{"*"*50}
"#{@command}" is not valid a valid argument to "rspec --configure".
Supported options are:

  rspec --configure autotest # generates configuration to run autotest with rspec

#{"*"*50}
MESSAGE
  end
end