rr 1.0.4 → 1.0.5.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. checksums.yaml +15 -0
  2. data/CHANGES.md +376 -0
  3. data/Gemfile +7 -10
  4. data/README.md +822 -0
  5. data/Rakefile +24 -78
  6. data/VERSION +1 -0
  7. data/lib/rr.rb +3 -0
  8. data/lib/rr/adapters/minitest.rb +6 -0
  9. data/lib/rr/adapters/rr_methods.rb +6 -10
  10. data/lib/rr/adapters/rspec.rb +3 -0
  11. data/lib/rr/adapters/rspec2.rb +30 -0
  12. data/lib/rr/adapters/test_unit.rb +2 -0
  13. data/lib/rr/double.rb +3 -2
  14. data/lib/rr/double_definitions/child_double_definition_create.rb +3 -2
  15. data/lib/rr/double_definitions/double_definition.rb +15 -13
  16. data/lib/rr/double_definitions/double_definition_create.rb +9 -5
  17. data/lib/rr/double_definitions/double_injections/any_instance_of.rb +3 -2
  18. data/lib/rr/double_definitions/strategies/strategy.rb +5 -4
  19. data/lib/rr/double_definitions/strategies/strategy_methods.rb +6 -8
  20. data/lib/rr/double_definitions/strategies/verification/mock.rb +3 -3
  21. data/lib/rr/double_matches.rb +2 -1
  22. data/lib/rr/expectations/argument_equality_expectation.rb +2 -2
  23. data/lib/rr/expectations/times_called_expectation.rb +2 -2
  24. data/lib/rr/injections/double_injection.rb +12 -11
  25. data/lib/rr/injections/injection.rb +2 -2
  26. data/lib/rr/injections/method_missing_injection.rb +21 -7
  27. data/lib/rr/injections/singleton_method_added_injection.rb +3 -1
  28. data/lib/rr/method_dispatches/base_method_dispatch.rb +1 -1
  29. data/lib/rr/method_dispatches/method_dispatch.rb +2 -1
  30. data/lib/rr/method_dispatches/method_missing_dispatch.rb +2 -1
  31. data/lib/rr/proc_from_block.rb +8 -4
  32. data/lib/rr/space.rb +3 -2
  33. data/lib/rr/times_called_matchers/times_called_matcher.rb +2 -2
  34. data/lib/rr/version.rb +5 -0
  35. data/lib/rr/wildcard_matchers/boolean.rb +2 -2
  36. data/spec/runner.rb +41 -0
  37. metadata +45 -133
  38. data/.gitignore +0 -10
  39. data/.runrc +0 -3
  40. data/.rvmrc +0 -2
  41. data/CHANGES +0 -266
  42. data/Gemfile.lock +0 -31
  43. data/README.rdoc +0 -392
  44. data/benchmarks/rr_benchmark.rb +0 -32
  45. data/benchmarks/rspec_benchmark.rb +0 -14
  46. data/doc/0.6.0.release.markdown +0 -81
  47. data/doc/todo.txt +0 -0
  48. data/introducting_rr.txt +0 -206
  49. data/rr.gemspec +0 -37
  50. data/spec/api/any_instance_of/all_instances_of_spec.rb +0 -12
  51. data/spec/api/any_instance_of/any_instance_of_spec.rb +0 -47
  52. data/spec/api/any_instance_of/instance_of_spec.rb +0 -12
  53. data/spec/api/dont_allow/dont_allow_after_stub_spec.rb +0 -14
  54. data/spec/api/mock/mock_spec.rb +0 -193
  55. data/spec/api/proxy/proxy_spec.rb +0 -86
  56. data/spec/api/spy/spy_spec.rb +0 -49
  57. data/spec/api/strong/strong_spec.rb +0 -87
  58. data/spec/api/stub/stub_spec.rb +0 -152
  59. data/spec/core_spec_suite.rb +0 -19
  60. data/spec/environment_fixture_setup.rb +0 -8
  61. data/spec/minitest_spec_suite.rb +0 -21
  62. data/spec/proc_from_block_spec.rb +0 -14
  63. data/spec/rr/adapters/rr_methods_argument_matcher_spec.rb +0 -67
  64. data/spec/rr/adapters/rr_methods_creator_spec.rb +0 -137
  65. data/spec/rr/adapters/rr_methods_space_spec.rb +0 -98
  66. data/spec/rr/adapters/rr_methods_spec_helper.rb +0 -11
  67. data/spec/rr/adapters/rr_methods_times_matcher_spec.rb +0 -13
  68. data/spec/rr/double_definitions/child_double_definition_creator_spec.rb +0 -112
  69. data/spec/rr/double_definitions/double_definition_create_blank_slate_spec.rb +0 -91
  70. data/spec/rr/double_definitions/double_definition_create_spec.rb +0 -443
  71. data/spec/rr/double_injection/double_injection_spec.rb +0 -546
  72. data/spec/rr/double_injection/double_injection_verify_spec.rb +0 -29
  73. data/spec/rr/errors/rr_error_spec.rb +0 -67
  74. data/spec/rr/expectations/any_argument_expectation_spec.rb +0 -47
  75. data/spec/rr/expectations/anything_argument_equality_expectation_spec.rb +0 -14
  76. data/spec/rr/expectations/argument_equality_expectation_spec.rb +0 -135
  77. data/spec/rr/expectations/boolean_argument_equality_expectation_spec.rb +0 -34
  78. data/spec/rr/expectations/hash_including_argument_equality_expectation_spec.rb +0 -82
  79. data/spec/rr/expectations/hash_including_spec.rb +0 -17
  80. data/spec/rr/expectations/satisfy_argument_equality_expectation_spec.rb +0 -59
  81. data/spec/rr/expectations/satisfy_spec.rb +0 -14
  82. data/spec/rr/expectations/times_called_expectation/times_called_expectation_any_times_spec.rb +0 -22
  83. data/spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb +0 -37
  84. data/spec/rr/expectations/times_called_expectation/times_called_expectation_at_most_spec.rb +0 -43
  85. data/spec/rr/expectations/times_called_expectation/times_called_expectation_helper.rb +0 -15
  86. data/spec/rr/expectations/times_called_expectation/times_called_expectation_integer_spec.rb +0 -58
  87. data/spec/rr/expectations/times_called_expectation/times_called_expectation_proc_spec.rb +0 -35
  88. data/spec/rr/expectations/times_called_expectation/times_called_expectation_range_spec.rb +0 -39
  89. data/spec/rr/minitest/minitest_integration_test.rb +0 -59
  90. data/spec/rr/minitest/test_helper.rb +0 -7
  91. data/spec/rr/rspec/invocation_matcher_spec.rb +0 -279
  92. data/spec/rr/rspec/rspec_adapter_spec.rb +0 -63
  93. data/spec/rr/rspec/rspec_backtrace_tweaking_spec.rb +0 -31
  94. data/spec/rr/rspec/rspec_backtrace_tweaking_spec_fixture.rb +0 -11
  95. data/spec/rr/rspec/rspec_usage_spec.rb +0 -86
  96. data/spec/rr/space/hash_with_object_id_key_spec.rb +0 -88
  97. data/spec/rr/space/space_spec.rb +0 -596
  98. data/spec/rr/test_unit/test_helper.rb +0 -7
  99. data/spec/rr/test_unit/test_unit_backtrace_test.rb +0 -36
  100. data/spec/rr/test_unit/test_unit_integration_test.rb +0 -59
  101. data/spec/rr/times_called_matchers/any_times_matcher_spec.rb +0 -47
  102. data/spec/rr/times_called_matchers/at_least_matcher_spec.rb +0 -55
  103. data/spec/rr/times_called_matchers/at_most_matcher_spec.rb +0 -70
  104. data/spec/rr/times_called_matchers/integer_matcher_spec.rb +0 -70
  105. data/spec/rr/times_called_matchers/proc_matcher_spec.rb +0 -55
  106. data/spec/rr/times_called_matchers/range_matcher_spec.rb +0 -76
  107. data/spec/rr/times_called_matchers/times_called_matcher_spec.rb +0 -118
  108. data/spec/rr/wildcard_matchers/anything_spec.rb +0 -24
  109. data/spec/rr/wildcard_matchers/boolean_spec.rb +0 -36
  110. data/spec/rr/wildcard_matchers/duck_type_spec.rb +0 -52
  111. data/spec/rr/wildcard_matchers/is_a_spec.rb +0 -32
  112. data/spec/rr/wildcard_matchers/numeric_spec.rb +0 -32
  113. data/spec/rr/wildcard_matchers/range_spec.rb +0 -35
  114. data/spec/rr/wildcard_matchers/regexp_spec.rb +0 -43
  115. data/spec/rr_spec.rb +0 -28
  116. data/spec/rspec_spec_suite.rb +0 -17
  117. data/spec/spec.opts +0 -10
  118. data/spec/spec_helper.rb +0 -41
  119. data/spec/spec_suite.rb +0 -54
  120. data/spec/spy_verification_spec.rb +0 -129
  121. data/spec/test_unit_spec_suite.rb +0 -21
@@ -6,9 +6,10 @@ module RR
6
6
  include RR::Adapters::RRMethods
7
7
 
8
8
  def call(subject_class, stubbed_methods=nil, &block)
9
- ::RR::DoubleDefinitions::DoubleDefinitionCreate.set_default_double_injection_strategy(lambda do |double_definition_create|
9
+ strategy_lambda = lambda do |double_definition_create|
10
10
  ::RR::DoubleDefinitions::Strategies::DoubleInjection::AnyInstanceOf.new(double_definition_create)
11
- end) do
11
+ end
12
+ ::RR::DoubleDefinitions::DoubleDefinitionCreate.set_default_double_injection_strategy(strategy_lambda) do
12
13
  if stubbed_methods
13
14
  subject_class.class_eval do
14
15
  stubbed_methods.each do |name, value|
@@ -3,21 +3,22 @@ module RR
3
3
  module Strategies
4
4
  class Strategy
5
5
  attr_reader :double_definition_create, :definition, :method_name, :args, :handler
6
+
6
7
  include Space::Reader
7
8
 
8
9
  def initialize(double_definition_create)
9
10
  @double_definition_create = double_definition_create
10
11
  end
11
-
12
+
12
13
  def call(definition, method_name, args, handler)
13
14
  @definition, @method_name, @args, @handler = definition, method_name, args, handler
14
15
  do_call
15
16
  end
16
17
 
17
18
  def verify_subject(subject)
18
- end
19
+ end
19
20
 
20
- protected
21
+ protected
21
22
  def do_call
22
23
  raise NotImplementedError
23
24
  end
@@ -40,4 +41,4 @@ module RR
40
41
  end
41
42
  end
42
43
  end
43
- end
44
+ end
@@ -4,10 +4,10 @@ module RR
4
4
  module StrategyMethods
5
5
  extend(Module.new do
6
6
  def lately_bound_alias_method(target_method_name, source_method_name)
7
- module_eval((<<-METHOD), __FILE__, __LINE__+1)
8
- def #{target_method_name}(*args, &block)
9
- #{source_method_name}(*args, &block)
10
- end
7
+ module_eval(<<-METHOD, __FILE__, __LINE__+1)
8
+ def #{target_method_name}(*args, &block)
9
+ #{source_method_name}(*args, &block)
10
+ end
11
11
  METHOD
12
12
  end
13
13
  end)
@@ -39,14 +39,12 @@ module RR
39
39
  def any_instance_of!(method_name=nil, &definition_eval_block)
40
40
  any_instance_of(Object.new, method_name, &definition_eval_block)
41
41
  end
42
- lately_bound_alias_method :all_instances_of, :any_instance_of
43
- lately_bound_alias_method :all_instances_of!, :any_instance_of!
44
42
 
45
43
  def instance_of!(method_name=nil, &definition_eval_block)
46
44
  instance_of(Object.new, method_name, &definition_eval_block)
47
45
  end
48
- lately_bound_alias_method :new_instance_of, :instance_of
49
- lately_bound_alias_method :new_instance_of!, :instance_of!
46
+ lately_bound_alias_method :all_instances_of, :instance_of
47
+ lately_bound_alias_method :all_instances_of!, :instance_of!
50
48
  end
51
49
  end
52
50
  end
@@ -14,7 +14,7 @@ module RR
14
14
  #
15
15
  # When passed the subject, a DoubleDefinitionCreateBlankSlate is returned. Passing
16
16
  # a method with arguments to the proxy will set up expectations that
17
- # the a call to the subject's method with the arguments will happen,
17
+ # a call to the subject's method with the arguments will happen,
18
18
  # and return the prescribed value.
19
19
  # mock(subject).method_name_1 {return_value_1}
20
20
  # mock(subject).method_name_2(arg1, arg2) {return_value_2}
@@ -29,7 +29,7 @@ module RR
29
29
  # mock(subject) do
30
30
  # method_name_1 {return_value_1}
31
31
  # method_name_2(arg_1, arg_2) {return_value_2}
32
- # end
32
+ # end
33
33
  class Mock < VerificationStrategy
34
34
  protected
35
35
  def do_call
@@ -39,4 +39,4 @@ module RR
39
39
  end
40
40
  end
41
41
  end
42
- end
42
+ end
@@ -5,6 +5,7 @@ module RR
5
5
  :exact_non_terminal_doubles_to_attempt,
6
6
  :wildcard_terminal_doubles_to_attempt,
7
7
  :wildcard_non_terminal_doubles_to_attempt
8
+
8
9
  def initialize(doubles) #:nodoc:
9
10
  @doubles = doubles
10
11
  @matching_doubles = []
@@ -39,4 +40,4 @@ module RR
39
40
  self
40
41
  end
41
42
  end
42
- end
43
+ end
@@ -32,10 +32,10 @@ module RR
32
32
  expected_arguments == other.expected_arguments
33
33
  end
34
34
 
35
- protected
35
+ protected
36
36
  def equality_match(arg1, arg2)
37
37
  arg1.respond_to?(:'__rr__original_==') ? arg1.__send__(:'__rr__original_==', arg2) : arg1 == arg2
38
38
  end
39
39
  end
40
40
  end
41
- end
41
+ end
@@ -40,7 +40,7 @@ module RR
40
40
  times_matcher.terminal?
41
41
  end
42
42
 
43
- protected
43
+ protected
44
44
  def times_matcher
45
45
  double.definition.times_matcher
46
46
  end
@@ -54,4 +54,4 @@ module RR
54
54
  end
55
55
  end
56
56
  end
57
- end
57
+ end
@@ -86,6 +86,7 @@ module RR
86
86
  end
87
87
  end
88
88
  end)
89
+
89
90
  include ClassInstanceMethodDefined
90
91
 
91
92
  attr_reader :subject_class, :method_name, :doubles
@@ -126,12 +127,12 @@ module RR
126
127
  BoundObjects[id] = subject_class
127
128
 
128
129
  subject_class.class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
129
- def #{method_name}(*args, &block)
130
- ::RR::Injections::DoubleInjection::BoundObjects[#{id}].class_eval do
131
- remove_method(:#{method_name})
130
+ def #{method_name}(*args, &block)
131
+ ::RR::Injections::DoubleInjection::BoundObjects[#{id}].class_eval do
132
+ remove_method(:#{method_name})
133
+ end
134
+ method_missing(:#{method_name}, *args, &block)
132
135
  end
133
- method_missing(:#{method_name}, *args, &block)
134
- end
135
136
  RUBY
136
137
  self
137
138
  end
@@ -141,11 +142,11 @@ module RR
141
142
  BoundObjects[id] = subject_class
142
143
 
143
144
  subject_class.class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
144
- def #{method_name}(*args, &block)
145
- arguments = MethodArguments.new(args, block)
146
- obj = ::RR::Injections::DoubleInjection::BoundObjects[#{id}]
147
- RR::Injections::DoubleInjection.dispatch_method(self, obj, :#{method_name}, arguments.arguments, arguments.block)
148
- end
145
+ def #{method_name}(*args, &block)
146
+ arguments = MethodArguments.new(args, block)
147
+ obj = ::RR::Injections::DoubleInjection::BoundObjects[#{id}]
148
+ RR::Injections::DoubleInjection.dispatch_method(self, obj, :#{method_name}, arguments.arguments, arguments.block)
149
+ end
149
150
  RUBY
150
151
  self
151
152
  end
@@ -203,7 +204,7 @@ module RR
203
204
  @dispatch_method_delegates_to_dispatch_original_method = nil
204
205
  end
205
206
 
206
- protected
207
+ protected
207
208
  def deferred_bind_method
208
209
  unless subject_has_method_defined?(original_method_alias_name)
209
210
  bind_method_with_alias
@@ -22,7 +22,7 @@ module RR
22
22
  subject_class.instance_method(original_method_alias_name)
23
23
  end
24
24
 
25
- protected
25
+ protected
26
26
  def subject_respond_to_method?(subject, method_name)
27
27
  subject_has_method_defined?(method_name) ||
28
28
  class_instance_method_defined(subject_class, :respond_to?) &&
@@ -30,4 +30,4 @@ module RR
30
30
  end
31
31
  end
32
32
  end
33
- end
33
+ end
@@ -12,9 +12,13 @@ module RR
12
12
  instances.include?(subject)
13
13
  end
14
14
  end)
15
+
16
+ BoundObjects = {}
17
+
15
18
  include ClassInstanceMethodDefined
16
19
 
17
20
  attr_reader :subject_class
21
+
18
22
  def initialize(subject_class)
19
23
  @subject_class = subject_class
20
24
  @placeholder_method_defined = false
@@ -30,6 +34,18 @@ module RR
30
34
  end
31
35
  end
32
36
  end
37
+ # Ruby 1.9 will raise a NoMethodError when #method_missing is defined
38
+ # on the subject, but #to_ary isn't. #method_missing will always be
39
+ # defined thanks to BasicObject, but #to_ary may not, so in this case
40
+ # we need to supply our own. Furthermore, Ruby has special logic to
41
+ # handle the return value of #to_ary; if it is nil, then it tells Ruby
42
+ # to ignore #to_ary altogether and use a default rule to arrayify the
43
+ # object in question.
44
+ unless class_instance_method_defined(subject_class, :to_ary)
45
+ subject_class.class_eval do
46
+ def to_ary; nil; end
47
+ end
48
+ end
33
49
  subject_class.__send__(:alias_method, original_method_alias_name, :method_missing)
34
50
  bind_method
35
51
  end
@@ -50,18 +66,16 @@ module RR
50
66
  end
51
67
  end
52
68
 
53
- protected
54
- BoundObjects = {}
55
-
69
+ protected
56
70
  def bind_method
57
71
  id = BoundObjects.size
58
72
  BoundObjects[id] = subject_class
59
73
 
60
74
  subject_class.class_eval((<<-METHOD), __FILE__, __LINE__ + 1)
61
- def method_missing(method_name, *args, &block)
62
- obj = ::RR::Injections::MethodMissingInjection::BoundObjects[#{id}]
63
- MethodDispatches::MethodMissingDispatch.new(self, obj, method_name, args, block).call
64
- end
75
+ def method_missing(method_name, *args, &block)
76
+ obj = ::RR::Injections::MethodMissingInjection::BoundObjects[#{id}]
77
+ MethodDispatches::MethodMissingDispatch.new(self, obj, method_name, args, block).call
78
+ end
65
79
  METHOD
66
80
  end
67
81
 
@@ -16,9 +16,11 @@ module RR
16
16
  instances.include?(subject)
17
17
  end
18
18
  end)
19
+
19
20
  include ClassInstanceMethodDefined
20
21
 
21
22
  attr_reader :subject_class
23
+
22
24
  def initialize(subject_class)
23
25
  @subject_class = subject_class
24
26
  @placeholder_method_defined = false
@@ -63,7 +65,7 @@ module RR
63
65
  end
64
66
  end
65
67
 
66
- protected
68
+ protected
67
69
  def original_method_alias_name
68
70
  "__rr__original_singleton_method_added"
69
71
  end
@@ -10,7 +10,7 @@ module RR
10
10
  raise NotImplementedError
11
11
  end
12
12
 
13
- protected
13
+ protected
14
14
  def find_double_to_attempt
15
15
  matches = DoubleMatches.new(doubles).find_all_matches(args)
16
16
 
@@ -2,6 +2,7 @@ module RR
2
2
  module MethodDispatches
3
3
  class MethodDispatch < BaseMethodDispatch
4
4
  attr_reader :double_injection, :subject
5
+
5
6
  def initialize(double_injection, subject, args, block)
6
7
  @double_injection, @subject, @args, @block = double_injection, subject, args, block
7
8
  @double = find_double_to_attempt
@@ -34,7 +35,7 @@ module RR
34
35
  end
35
36
  end
36
37
 
37
- protected
38
+ protected
38
39
  def call_implementation
39
40
  if implementation_is_original_method?
40
41
  call_original_method
@@ -8,6 +8,7 @@ module RR
8
8
  end)
9
9
 
10
10
  attr_reader :subject, :subject_class, :method_name
11
+
11
12
  def initialize(subject, subject_class, method_name, args, block)
12
13
  @subject, @subject_class, @method_name, @args, @block = subject, subject_class, method_name, args, block
13
14
  end
@@ -36,7 +37,7 @@ module RR
36
37
  end
37
38
  end
38
39
 
39
- protected
40
+ protected
40
41
  def call_implementation
41
42
  if implementation_is_original_method?
42
43
  space.record_call(subject, method_name, args, block)
@@ -1,7 +1,11 @@
1
1
  module RR
2
- class ProcFromBlock < Proc
3
- def ==(other)
4
- Proc.new(&self) == other
2
+ if RUBY_VERSION =~ /^1.8/
3
+ class ProcFromBlock < Proc
4
+ def ==(other)
5
+ Proc.new(&self) == other
6
+ end
5
7
  end
8
+ else
9
+ ProcFromBlock = Proc
6
10
  end
7
- end
11
+ end
data/lib/rr/space.rb CHANGED
@@ -13,7 +13,7 @@ module RR
13
13
  end
14
14
  attr_writer :instance
15
15
 
16
- protected
16
+ protected
17
17
  def method_missing(method_name, *args, &block)
18
18
  instance.__send__(method_name, *args, &block)
19
19
  end
@@ -21,6 +21,7 @@ module RR
21
21
 
22
22
  attr_reader :ordered_doubles, :recorded_calls
23
23
  attr_accessor :trim_backtrace
24
+
24
25
  def initialize
25
26
  @ordered_doubles = []
26
27
  @trim_backtrace = false
@@ -86,7 +87,7 @@ module RR
86
87
  ]
87
88
  end
88
89
 
89
- protected
90
+ protected
90
91
  # Removes the ordered Doubles from the list
91
92
  def reset_ordered_doubles
92
93
  @ordered_doubles.clear
@@ -35,10 +35,10 @@ module RR
35
35
  "#{@times.inspect} times"
36
36
  end
37
37
 
38
- protected
38
+ protected
39
39
  def pluralized_time(times_called)
40
40
  (times_called == 1) ? "time" : "times"
41
41
  end
42
42
  end
43
43
  end
44
- end
44
+ end
data/lib/rr/version.rb ADDED
@@ -0,0 +1,5 @@
1
+
2
+ module RR
3
+ VERSION = File.read(File.expand_path('../../../VERSION', __FILE__))
4
+ def self.version; VERSION; end
5
+ end
@@ -14,10 +14,10 @@ module RR
14
14
  'boolean'
15
15
  end
16
16
 
17
- protected
17
+ protected
18
18
  def is_a_boolean?(subject)
19
19
  subject.is_a?(TrueClass) || subject.is_a?(FalseClass)
20
20
  end
21
21
  end
22
22
  end
23
- end
23
+ end
data/spec/runner.rb ADDED
@@ -0,0 +1,41 @@
1
+ require 'session'
2
+
3
+ class SuitesRunner
4
+ TEST_SUITES = [
5
+ [:rspec, 'RSpec', 'RSpec'],
6
+ [:test_unit, 'TestUnit', 'Test::Unit'],
7
+ [:minitest, 'Minitest', 'MiniTest']
8
+ ]
9
+
10
+ attr_reader :bash
11
+
12
+ def initialize
13
+ @bash = Session::Bash.new
14
+ end
15
+
16
+ def run
17
+ TEST_SUITES.each_with_index do |(path, class_fragment, desc), i|
18
+ puts "----------------" unless i == 0
19
+ run_examples(path, class_fragment, desc)
20
+ puts
21
+ end
22
+ end
23
+
24
+ def run_examples(path, class_fragment, desc)
25
+ path = File.expand_path("../suites/#{path}/runner.rb", __FILE__)
26
+ # From http://www.eglug.org/node/946
27
+ bash.execute "exec 3>&1", :out => STDOUT, :err => STDERR
28
+ # XXX: why are we checking for this warning here...
29
+ bash.execute "ruby -W #{path} 2>&1 >&3 3>&- | grep -v 'warning: useless use of' 3>&-; STATUS=${PIPESTATUS[0]}", :out => STDOUT, :err => STDERR
30
+ status = bash.execute("echo $STATUS")[0].to_s.strip.to_i
31
+ bash.execute "exec 3>&-", :out => STDOUT, :err => STDERR
32
+ unless status == 0
33
+ raise "#{desc} Suite Failed"
34
+ end
35
+ end
36
+ end
37
+
38
+ if $0 == __FILE__
39
+ SuitesRunner.new.run
40
+ end
41
+