GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Description: Merb Core: All you need. None you don't.
Homepage: http://www.merbivore.com
Clone URL: git://github.com/wycats/merb-core.git
Spec runner exits with the correct status
carllerche (author)
Wed Oct 08 15:46:35 -0700 2008
Drew Colthorp (committer)
Fri Oct 10 10:54:13 -0700 2008
commit  3d4aa1efad1d25de4d8cf93f2fde64b83bb9c30b
tree    015db498e931a6d14ef969db59c5ae17bc1527b5
parent  9fac4f3596316effa432996a2f8fdf523f12c2a0
...
104
105
106
107
 
 
108
109
110
...
120
121
122
123
 
124
125
126
...
128
129
130
131
 
132
133
134
 
135
136
137
138
139
140
 
141
...
104
105
106
 
107
108
109
110
111
...
121
122
123
 
124
125
126
127
...
129
130
131
 
132
133
134
 
135
136
137
138
139
140
 
141
142
0
@@ -104,7 +104,8 @@ def run_specs(globs, spec_cmd='spec', run_opts = "-c", except = [])
0
   globs = globs.is_a?(Array) ? globs : [globs]
0
   
0
   counter = Merb::Counter.new
0
- forks = 0
0
+ forks = 0
0
+ failure = false
0
 
0
   time = Benchmark.measure do
0
     pid = nil
0
@@ -120,7 +121,7 @@ def run_specs(globs, spec_cmd='spec', run_opts = "-c", except = [])
0
           def out.tty?() true end
0
           options = Spec::Runner::OptionParser.parse(%W(#{spec} -fs --color), err, out)
0
           options.filename_pattern = File.expand_path(spec)
0
- Spec::Runner::CommandLine.run(options)
0
+ failure = ! Spec::Runner::CommandLine.run(options)
0
           begin
0
             counter_client.add(spec, out.string, err.string)
0
           rescue DRb::DRbConnError => e
0
@@ -128,14 +129,14 @@ def run_specs(globs, spec_cmd='spec', run_opts = "-c", except = [])
0
             puts "#{e.class}: #{e.message}"
0
             retry
0
           end
0
- exit
0
+ exit(failure ? -1 : 0)
0
         end
0
       end
0
- Process.waitall
0
+ failure = Process.waitall.any? { |pid, s| !s.success? }
0
     end
0
   end
0
   
0
   counter.time = time
0
   counter.report
0
- exit!
0
+ exit!(failure ? -1 : 0)
0
 end

Comments

    No one has commented yet.