Class: BocaGolf::CommandLine

Inherits:
Object
  • Object
show all
Defined in:
lib/boca_golf/command_line.rb

Instance Method Summary collapse

Instance Method Details

#run(args, stdout, stderr) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/boca_golf/command_line.rb', line 3

def run(args, stdout, stderr)
  ::Rspec::Core::Runner.disable_autorun!

  gist_location, *specs = *args
  stdout.puts "Testing #{gist_location} against specs:"
  specs.each do |spec|
    stdout.puts "  - #{spec}"
  end
  stdout.puts

  result = BocaGolf.new.run args, stdout, stderr

  stdout.puts "\nCode:"
  stdout.puts result.gist.code
  stdout.puts "\nScore:"
  stdout.puts result.score
end