Module: Overcommit::Hook::Shared::RSpec

Included in:
PreCommit::RSpec, PrePush::RSpec
Defined in:
lib/overcommit/hook/shared/r_spec.rb

Overview

Runs ‘rspec` test suite before push

See Also:

Instance Method Summary collapse

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/overcommit/hook/shared/r_spec.rb', line 8

def run
  result = if @config['include']
             execute(command, args: applicable_files)
           else
             execute(command)
           end

  return :pass if result.success?

  output = result.stdout + result.stderr
  [:fail, output]
end