Permalink
Browse files

Account for method renamings in latest RSpec version

  • Loading branch information...
1 parent 4a87598 commit 2ab9cf692d6d81eff55bd8524799481bc0cc5e57 @jcrossley3 jcrossley3 committed Nov 7, 2011
Showing with 22 additions and 2 deletions.
  1. +22 −2 lib/torquespec/daemon.rb
View
@@ -56,14 +56,34 @@ def run(alien, reporter)
# Intended to extend an RSpec::Core::ExampleGroup
module Client
+ def torquespec_before_alls
+ if respond_to?(:eval_before_alls)
+ eval_before_alls(new) # v 2.3
+ elsif respond_to?(:run_before_all_hooks)
+ run_before_all_hooks(new) # 2.7
+ else
+ raise "Unknown method to run before(:all) hooks"
+ end
+ end
+
+ def torquespec_after_alls
+ if respond_to?(:eval_after_alls)
+ eval_after_alls(new) # v 2.3
+ elsif respond_to?(:run_after_all_hooks)
+ run_after_all_hooks(new) # 2.7
+ else
+ raise "Unknown method to run after(:all) hooks"
+ end
+ end
+
def run(reporter)
begin
- eval_before_alls(new)
+ torquespec_before_alls
run_remotely(reporter)
rescue Exception => ex
fail_filtered_examples(ex, reporter)
ensure
- eval_after_alls(new)
+ torquespec_after_alls
end
end

0 comments on commit 2ab9cf6

Please sign in to comment.