aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/testing/mochaing.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2011-03-31 12:25:04 -0700
committerDavid Heinemeier Hansson <david@loudthinking.com>2011-03-31 12:25:04 -0700
commit6eff04499e28865890e1ae3915fe80e4903a997b (patch)
treecd4f7cd98519a3bdc7ec5665f0aec7133e0dba10 /activesupport/lib/active_support/testing/mochaing.rb
parentedf7c9a6a3331bfc0beabc9dc9c8beac22677e53 (diff)
downloadrails-6eff04499e28865890e1ae3915fe80e4903a997b.tar.gz
rails-6eff04499e28865890e1ae3915fe80e4903a997b.tar.bz2
rails-6eff04499e28865890e1ae3915fe80e4903a997b.zip
Add using Turn with natural language test case names if the library is available (which it will be in Rails 3.1) [DHH]
Diffstat (limited to 'activesupport/lib/active_support/testing/mochaing.rb')
-rw-r--r--activesupport/lib/active_support/testing/mochaing.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/testing/mochaing.rb b/activesupport/lib/active_support/testing/mochaing.rb
new file mode 100644
index 0000000000..4ad75a6681
--- /dev/null
+++ b/activesupport/lib/active_support/testing/mochaing.rb
@@ -0,0 +1,7 @@
+begin
+ silence_warnings { require 'mocha' }
+rescue LoadError
+ # Fake Mocha::ExpectationError so we can rescue it in #run. Bleh.
+ Object.const_set :Mocha, Module.new
+ Mocha.const_set :ExpectationError, Class.new(StandardError)
+end \ No newline at end of file