Sha256: 7baec65c8919af94ed6b5e7396373b5c9d92610693347896184efc08a1d85ebd
Contents?: true
Size: 983 Bytes
Versions: 2
Compression:
Stored size: 983 Bytes
Contents
require "simplecov" SimpleCov.start require 'bundler/setup' Bundler.setup require 'rails' require 'active_record' require 'timecop' require 'sidekiq' require 'rspec-sidekiq' require 'delayed_cron/railtie' DelayedCron::Railtie.insert RSpec.configure do |config| end def setup(options) DelayedCron.setup do |config| config.default_interval = options[:default_interval] config.default_time_zone = options[:default_time_zone] config.cron_jobs = options[:cron_jobs] || [] end end def build_class(class_name, name, options = {}) # setup class and include delayed_cron ActiveRecord::Base.send(:include, DelayedCron::Glue) Object.send(:remove_const, class_name) rescue nil # Set class as a constant klass = Object.const_set(class_name, Class.new(ActiveRecord::Base)) # Setup class with paperclip and delayed paperclip klass.class_eval do include DelayedCron::Glue cron_job name, options def self.test_method end end klass end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
delayed_cron-0.2.11 | spec/spec_helper.rb |
delayed_cron-0.2.10 | spec/spec_helper.rb |