Sha256: 81f86ba7d70d8a4d2207f84de75b6350c8eb02d4a5f01823ef6994bbfee66035
Contents?: true
Size: 456 Bytes
Versions: 10
Compression:
Stored size: 456 Bytes
Contents
module DeviseHelpers # Execute the block setting the given values and restoring old values after # the block is executed. def swap(object, new_values) old_values = {} new_values.each do |key, value| old_values[key] = object.send key object.send :"#{key}=", value end yield ensure old_values.each do |key, value| object.send :"#{key}=", value end end end RSpec::configure { |c| c.include DeviseHelpers }
Version data entries
10 entries across 10 versions & 2 rubygems