]> git.openstreetmap.org Git - rails.git/blob - vendor/gems/rspec-1.1.2/lib/spec.rb
fix node relations bug (thanks Dave!)
[rails.git] / vendor / gems / rspec-1.1.2 / lib / spec.rb
1 require 'spec/version'
2 require 'spec/matchers'
3 require 'spec/expectations'
4 require 'spec/example'
5 require 'spec/extensions'
6 require 'spec/runner'
7
8 if Object.const_defined?(:Test); \
9   require 'spec/interop/test'; \
10 end
11
12 module Spec
13   class << self
14     def run?
15       @run || rspec_options.examples_run?
16     end
17
18     def run; \
19       return true if run?; \
20       result = rspec_options.run_examples; \
21       @run = true; \
22       result; \
23     end
24     attr_writer :run
25     
26     def exit?; \
27       !Object.const_defined?(:Test) || Test::Unit.run?; \
28     end
29   end
30 end
31
32 at_exit do \
33   unless $! || Spec.run?; \
34     success = Spec.run; \
35     exit success if Spec.exit?; \
36   end \
37 end