Sha256: 29d96cf34459b4463f5f9bdad7fe4116ddd87983d1508a5a1b0c0845acd09971

Contents?: true

Size: 907 Bytes

Versions: 19

Compression:

Stored size: 907 Bytes

Contents

# For testing rake tasks
require 'rake'
# Task names should be used in the top-level describe, with an optional
# "rake "-prefix for better documentation. Both of these will work:
#
# 1) describe 'foo:bar' do ... end
#
# 2) describe 'rake foo:bar' do ... end
#
# Favor including 'rake '-prefix as in the 2nd example above as it produces
# doc output that makes it clear a rake task is under test and how it is
# invoked.
module TaskExampleGroup
  extend ActiveSupport::Concern
  included do
    let(:task_name) { self.class.top_level_description.sub(/\Arake /, '') }
    let(:tasks) { Rake::Task }
    subject(:task) { tasks[task_name] }
  end
end

RSpec.configure do |config|
  config.define_derived_metadata(:file_path => %r{/spec/tasks/}) do |metadata|
    metadata[:type] = :task
  end
  config.include TaskExampleGroup, type: :task
  config.before(:suite) do
    Rails.application.load_tasks
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
enju_circulation-0.3.11 spec/support/tasks.rb
enju_circulation-0.3.10 spec/support/tasks.rb
enju_circulation-0.3.9 spec/support/tasks.rb
enju_circulation-0.4.0.rc.1 spec/support/tasks.rb
enju_circulation-0.3.8 spec/support/tasks.rb
enju_circulation-0.3.7 spec/support/tasks.rb
enju_circulation-0.4.0.beta.4 spec/support/tasks.rb
enju_circulation-0.4.0.beta.3 spec/support/tasks.rb
enju_circulation-0.3.6 spec/support/tasks.rb
enju_circulation-0.4.0.beta.2 spec/support/tasks.rb
enju_circulation-0.4.0.beta.1 spec/support/tasks.rb
enju_circulation-0.3.5 spec/support/tasks.rb
enju_circulation-0.3.4 spec/support/tasks.rb
enju_circulation-0.3.3 spec/support/tasks.rb
enju_circulation-0.3.2 spec/support/tasks.rb
enju_circulation-0.3.1 spec/support/tasks.rb
enju_circulation-0.3.0 spec/support/tasks.rb
enju_circulation-0.3.0.rc.1 spec/support/tasks.rb
enju_circulation-0.3.0.beta.1 spec/support/tasks.rb