11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/rspec_atoms/cli.rb', line 11
def self.start(arguments, output: $stdout, error: $stderr)
arguments = arguments.dup
command = arguments.shift
case command
when "discover"
Discover.call(arguments, output: output, error: error)
when "run"
junit_output = (
arguments,
"--junit",
default: Run::DEFAULT_JUNIT_OUTPUT
)
arguments.shift if arguments.first == "--"
Run.call(
arguments,
junit_output: junit_output,
output: output,
error: error
)
when "version", "--version", "-v"
output.puts(VERSION)
0
else
error.puts(usage)
EXIT_USAGE
end
rescue ArgumentError => exception
error.puts(exception.message)
error.puts(usage)
EXIT_USAGE
end
|