Class: Spec::Runner::ClassAndArgumentsParser

Inherits:
Object
  • Object
show all
Defined in:
lib/gems/rspec-1.1.12/lib/spec/runner/class_and_arguments_parser.rb

Class Method Summary collapse

Class Method Details

.parse(s) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/gems/rspec-1.1.12/lib/spec/runner/class_and_arguments_parser.rb', line 4

def self.parse(s)
  if s =~ /([a-zA-Z_]+(?:::[a-zA-Z_]+)*):?(.*)/
    arg = $2 == "" ? nil : $2
    [$1, arg]
  else
    raise "Couldn't parse #{s.inspect}"
  end
end