summaryrefslogtreecommitdiff
path: root/test/support/with_config_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/support/with_config_helper.rb')
-rw-r--r--test/support/with_config_helper.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/support/with_config_helper.rb b/test/support/with_config_helper.rb
new file mode 100644
index 0000000..65eb7bc
--- /dev/null
+++ b/test/support/with_config_helper.rb
@@ -0,0 +1,16 @@
+module WithConfigHelper
+ extend ActiveSupport::Concern
+
+ def with_config(options)
+ old_config = APP_CONFIG.dup
+ APP_CONFIG.merge! options
+ yield
+ ensure
+ APP_CONFIG.replace old_config
+ end
+
+end
+
+class ActiveSupport::TestCase
+ include WithConfigHelper
+end