Sha256: c16e719333fe838cb4a7230b36d44b8d5779d28372b880ecf49775f50040e61e

Contents?: true

Size: 1.81 KB

Versions: 11

Compression:

Stored size: 1.81 KB

Contents

require 'bundler/setup'
Bundler.setup

require 'simplecov'
require 'coveralls'
require 'pry'
require 'active_support/notifications'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
  SimpleCov::Formatter::HTMLFormatter,
  Coveralls::SimpleCov::Formatter
]

SimpleCov.start do
  add_filter 'spec'
end

require 'delayed_job'

require 'sidekiq'
require 'rspec-sidekiq'
Sidekiq::Testing.fake!

require 'resque'
require 'resque_spec'
ResqueSpec.disable_ext = false

require 'taskinator'

Taskinator.configure do |config|

  # use active support for instrumentation
  config.instrumenter = ActiveSupport::Notifications

  # use a "null stream" for logging
  config.logger = Logger.new(File::NULL)

end

# require supporting files with custom matchers and macros, etc
Dir[File.expand_path("../support/**/*.rb", __FILE__)].each {|f| require f }

RSpec.configure do |config|

  config.expect_with :rspec do |c|
    c.syntax = [:should, :expect]
  end

  config.mock_with :rspec do |c|
    c.syntax = :expect
  end

  config.order = :random
  config.fail_fast = (ENV["FAIL_FAST"] == 1)

  config.before(:each) do
    Taskinator.queue_adapter = :test_queue
  end

  config.before(:each, :redis => true) do
    Taskinator.redis = { :namespace => 'taskinator:test' }
    Taskinator.redis do |conn|
      conn.flushdb
    end
  end

  config.before(:each, :sidekiq => true) do
    Sidekiq::Worker.clear_all
  end

  config.before(:each, :delayed_job => true) do
    Delayed::Job.clear_all
  end

end

# require examples, must happen after configure
Dir[File.expand_path("../examples/**/*.rb", __FILE__)].each {|f| require f }

def recursively_enumerate_tasks(tasks, &block)
  tasks.each do |task|
    if task.is_a?(Taskinator::Task::SubProcess)
      recursively_enumerate_tasks(task.sub_process.tasks, &block)
    else
      yield task
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
taskinator-0.3.10 spec/spec_helper.rb
taskinator-0.3.9 spec/spec_helper.rb
taskinator-0.3.7 spec/spec_helper.rb
taskinator-0.3.6 spec/spec_helper.rb
taskinator-0.3.5 spec/spec_helper.rb
taskinator-0.3.3 spec/spec_helper.rb
taskinator-0.3.2 spec/spec_helper.rb
taskinator-0.3.1 spec/spec_helper.rb
taskinator-0.3.0 spec/spec_helper.rb
taskinator-0.2.0 spec/spec_helper.rb
taskinator-0.0.18 spec/spec_helper.rb