Module: PrePush::ClassMethods

Defined in:
lib/pre_push.rb

Instance Method Summary collapse

Instance Method Details

#buildObject



18
19
20
21
# File 'lib/pre_push.rb', line 18

def build
  system "#{msbuild} #{@solution}"
  $?.success?
end

#runObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/pre_push.rb', line 6

def run
  success = build
  if (!success)
    puts 'build has failed'
    exit(1)
  end
  success = run_tests(@assemblies)
  if (!success)
    puts 'Tests have failed'
    exit(1)
  end
end

#run_tests(assemblies) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/pre_push.rb', line 22

def run_tests assemblies
assemblies = assemblies.to_a.empty? ? [@solution] : assemblies
success = true
  gem_lib = File.dirname(__FILE__)
  tests_to_run = @tests_to_run || {@test_runner => assemblies}
  tests_to_run.each_pair do |test_to_run|
  test_to_run[1].each do |assembly|
    system "#{test_runner_path(gem_lib, test_to_run[0])} \"#{assembly}\""
    success &= $?.success?
  end
 end
  success
end