Class: RequestMigrations::Testing
- Inherits:
-
Object
- Object
- RequestMigrations::Testing
- Defined in:
- lib/request_migrations/testing.rb
Constant Summary collapse
- @@config =
RequestMigrations::Configuration.new
Class Method Summary collapse
-
.setup! ⇒ Object
setup! stores the original config and replaces it with a clone for testing.
-
.teardown! ⇒ Object
teardown! restores the original config.
Class Method Details
.setup! ⇒ Object
setup! stores the original config and replaces it with a clone for testing.
9 10 11 12 13 14 15 16 |
# File 'lib/request_migrations/testing.rb', line 9 def self.setup! @@config = RequestMigrations.config RequestMigrations.reset! RequestMigrations.configure do |config| @@config.config.each { |(k, v)| config.config[k] = v } end end |
.teardown! ⇒ Object
teardown! restores the original config.
20 21 22 |
# File 'lib/request_migrations/testing.rb', line 20 def self.teardown! RequestMigrations.config = @@config end |