diff --git a/rspec_utils/timecop_module.rb b/rspec_utils/timecop_module.rb index b183a2c..9041873 100644 --- a/rspec_utils/timecop_module.rb +++ b/rspec_utils/timecop_module.rb @@ -1,12 +1,12 @@ -# Call rubocop directly from rspec metadata, example: +# Call timecop directly from rspec metadata, example: # Rspec.describe 'what_to_test', timecop: { travel: Time.local(2016, 10, 15) } do -AVALIABLE_METHODS = %w(freeze return scale travel).freeze +AVAILABLE_METHODS = %w(freeze return scale travel).freeze module TimecopModule RSpec.configure do |config| config.around(:example, :timecop) do |example| example.metadata[:timecop].each do |method, params| - Timecop.public_send(method, params) if AVALIABLE_METHODS.include? method.to_s + Timecop.public_send(method, params) if AVAILABLE_METHODS.include? method.to_s end example.run end